我遇到了一个奇怪的问题,我花了几天时间才找到根本原因,但我无法理解它。应用程序崩溃并给出: “Microsoft JScript 运行时错误:Sys.WebForms.PageRequestManagerParserErrorException:无法解析从服务器接收到的消息。”
我读到了错误,不,我没有使用:Response.Write,Filters...等
应用程序:ASP.Net Web 应用程序、.Net 4 和 IIS 7.0。在一个页面中,我有一个 AJAX 选项卡控件(在更新面板中),当我更改选项卡时会引发此错误。
由于一些对 asp.net 标签的赋值语句,错误被抛出!这是我的 ASP.Net 代码(我不能放整个页面,所以这只是我认为给出错误的部分):
<asp:Panel ID="pnlLocInfo" runat="server">
<div style="float: left; margin-left: 12%">
<p style="font-size: medium">
<b>As requested</b></p>
</div>
<div style="float: left; margin-left: 17%">
<p style="font-size: medium">
<b>Current</b></p>
</div>
<div style="width: 45%; font-size: small; margin-left: 5%">
<div style="width: 30%; float: left; margin-right: 20px">
<b>District:</b>
<asp:Label runat="server" ID="lblARDist" Text="1"></asp:Label>
<br />
<b>Route:</b>
<asp:Label runat="server" ID="lblARRte" Text="US-30"></asp:Label>
<br />
<b>Ref post:</b>
<asp:Label runat="server" ID="lblARRefPost" Text="85"></asp:Label>
<br />
<b>Direction:</b>
<asp:Label runat="server" ID="lblARDir" Text="North"></asp:Label>
<br />
<b>Section:</b>
<asp:Label runat="server" ID="lblARSec" Text="17"></asp:Label>
<br />
<b>Range:</b>
<asp:Label runat="server" ID="lblARRange" Text="R23W"></asp:Label>
</div>
<div style="width: 35%; float: left">
<b>County:</b>
<asp:Label runat="server" ID="lblARCnty" Text="85 - Story"></asp:Label>
<br />
<b>Priority:</b>
<asp:Label runat="server" ID="lblARPriClass" Text="1"></asp:Label>
<br />
<b>Offset:</b>
<asp:Label runat="server" ID="lblARoffset" Text="5"></asp:Label>
<br />
<b>Side:</b>
<asp:Label runat="server" ID="lblARSide" Text="Left"></asp:Label>
<br />
<b>Twnshp:</b>
<asp:Label runat="server" ID="lblARTwnshp" Text="20"></asp:Label>
</div>
</div>
<div style="width: 45%; font-size: small; float: left; left: 10px; border-left-style: solid;
border-left-width: medium;">
<div style="width: 30%; float: left; margin-left: 15px; margin-right: 20px">
<b>District:</b>
<asp:Label runat="server" ID="lblFRDist" Text="1"></asp:Label>
<br />
<b>Route:</b>
<asp:Label runat="server" ID="lblFRRte" Text="US-30"></asp:Label>
<br />
<b>Ref post:</b>
<asp:Label runat="server" ID="lblFRRefPost" Text="86"></asp:Label>
<br />
<b>Direction:</b>
<asp:Label runat="server" ID="lblFRDir" Text="North"></asp:Label>
<br />
<b>Section:</b>
<asp:Label runat="server" ID="lblFRSec" Text="17"></asp:Label>
<br />
<b>Range:</b>
<asp:Label runat="server" ID="lblFRRange" Text="R23W"></asp:Label>
</div>
<div style="width: 35%; float: left; margin-left: 15px">
<b>County:</b>
<asp:Label runat="server" ID="lblFRCo" Text="85 - Story"></asp:Label>
<br />
<b>Priority:</b>
<asp:Label runat="server" ID="lblFRPriClass" Text="1"></asp:Label>
<br />
<b>Offset:</b>
<asp:Label runat="server" ID="lblFRRefPost_Offset" Text="20"></asp:Label>
<br />
<b>Side:</b>
<asp:Label runat="server" ID="Label40" Text="Left"></asp:Label>
<br />
<b>Twnshp:</b>
<asp:Label runat="server" ID="lblFRTwnshp" Text="20"></asp:Label>
</div>
<asp:Button runat="server" ID="btnModifyLoc" Text="Update location" /></div>
</asp:Panel>
在我后面的代码(VB.Net)中,我只是为这些标签赋值:
lblARCnty.Text = objEntrancePermit.PermitLocation.County.ID
lblARDist.Text = objEntrancePermit.PermitLocation.District.ID
lblARDir.Text = objEntrancePermit.PermitLocation.DirectionOfTravel
lblARSide.Text = objEntrancePermit.PermitLocation.SideOfRoad
lblARRte.Text = objEntrancePermit.PermitLocation.Route.ID
...etc
如果我注释掉分配,我的应用程序会正常工作,如果我取消注释它会给我错误!
任何想法或想法将不胜感激
谢谢贾法尔