Sys.WebForms.PageRequestManagerServerErrorException:发生未知错误状态代码12152

时间:2012-10-23 11:44:34

标签: asp.net asp.net-ajax windows-server-2003

我创建了一个网站并在Windows Server 2003上托管它。我在整页中使用了带有更新面板标记的Ajax 3.5。

我的第一页是主页,只包含一个下拉菜单和一个按钮。

当我从下拉列表中选择文本并单击按钮时。它重定向主页面。

主页面包含一些文本框和更新面板中的按钮。

例如。

<CC1:ToolkitScriptManager ID="sm" runat="server"  />
            <div>
            <asp:UpdatePanel ID="update" runat="server">
            <ContentTemplate>
            <table cellpadding="0" cellspacing="0" border="0" width="960px">
            <tr> 
            <td align="left">
            <asp:Panel ID="pnlAjax" runat="server" Width="500px" BorderStyle="Double" BorderWidth="5" BorderColor="Brown">
        // Code Here
        // This a the few part of the code.
           </asp:panel>
        </td>
        </tr>
        <tr>
        <td>
        <asp:button ID="btnSubmit" runat="server" text="Submit"/>
        </td>
        </tr>

        </table>
         </ContentTemplate>
            </asp:UpdatePanel>

我没有使用Asyncpostbacktrigger标签。当我填写文本框中的详细信息并单击提交按钮以将详细信息保存在sql server数据库中。它不会处理并重定向到包含下拉列表和按钮的主页,而不会在Windows Server 2003上显示任何消息。当我从IIS运行此网站时,它显示以下消息:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12152

我已经用Google搜索了但没有帮助。有什么问题?有趣的是这个网站在Windows XP上运行良好。请帮助解决问题。

1 个答案:

答案 0 :(得分:0)

使用AJAX时,来自服务器的任何客户端脚本都应使用ScriptManager类。在这种情况下,因为您希望它立即运行,请使用ScriptManager.RegisterStartupScript().

ScriptManager.RegisterStartupScript(Page, typeof(Page), "MyScript", "confirm('Select True or False in exempt field.')", true);
相关问题