将ASP.NET 3.5更新为4.0->;Sys.WebForms.PageRequestManager未定义

将ASP.NET 3.5更新为4.0->;Sys.WebForms.PageRequestManager未定义,asp.net,.net,asp.net-ajax,updatepanel,Asp.net,.net,Asp.net Ajax,Updatepanel,正如标题所示,我最近将包含UpdatePanels和类似AJAX技术的ASP.NET3.5应用程序更新为ASP.NET4.0。不幸的是,UpdatePanel不再起作用,而整页回发使它变得更糟 Web.config-file <?xml version="1.0"?> <configuration> <configSections> <section name="exceptionHandling" type="Microso

正如标题所示,我最近将包含UpdatePanels和类似AJAX技术的ASP.NET3.5应用程序更新为ASP.NET4.0。不幸的是,UpdatePanel不再起作用,而整页回发使它变得更糟

Web.config-file

 <?xml version="1.0"?>
 <configuration>
    <configSections>
        <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"/>
        <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging"/>
        <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data"/>
    </configSections>
    <system.net>
        <mailSettings>
            <smtp>
                <network host="localhost"/>
            </smtp>
        </mailSettings>
    </system.net>
    <system.web>
        <!--
             The <authentication> section enables configuration 
             of the security authentication mode used by 
             ASP.NET to identify an incoming user. 
         -->
        <authentication mode="Forms">
            <forms loginUrl="~/Login.aspx" name=".ASPXFORMSAUTH" defaultUrl="~/Administration/SystemEvents.aspx"/>
        </authentication>
        <!--
             The <customErrors> section enables configuration 
             of what to do if/when an unhandled error occurs 
             during the execution of a request. Specifically, 
             it enables developers to configure html error pages 
             to be displayed in place of a error stack trace. -->
        <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx">
            <error statusCode="401" redirect="~/Unauthorized.aspx"/>
        </customErrors>
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>
 </configuration>

有什么我会做错的?谢谢大家!

。。。我自己通过替换UpdatePanel和删除脚本管理器解决了这个问题。

最近我在更新一个旧项目时遇到了问题,并按照上面的步骤进行了操作,但仍然出现了相同的错误。我发现我需要更新web.config文件中的一行来修复它

我改变了:

<xhtmlConformance mode="Legacy"/>

致:



在ScriptManager中设置
EnablePartialRendering=“false”
我知道这篇文章很老了,但是我解决这个问题的方法在这里没有给出。。所以我认为再增加一种方式也不错。 我试过了

在ScriptManager中设置EnablePartialRendering=“false”

它工作了,但是每点击一次,页面就会被完全加载,这是我不想要的。 我所做的就是在Page_Load()中添加了一行。btnexport是按钮id

ScriptManager.GetCurrent(Page).RegisterPostBackControl(btnexport);
我第一次尝试在回发之外使用它,但我的要求是即使在更新面板中的每次下拉单击之后也要导出,所以按钮不起作用。 然后当我把它放在回邮里。。。瞧!!它就像一个符咒。 因此,您可以根据需要将其放在外部或内部回发

还有一个解决方案-您可以这样做-

你可能忘了像我一样在asp:updatepanel中添加触发器。 将此添加到updatepanel中,瞧

<Triggers>
      <asp:PostBackTrigger ControlID="btnexport" />
</Triggers>

尝试了所有其他解决方案,但这对我很有效。。谢谢:)
ScriptManager.GetCurrent(Page).RegisterPostBackControl(btnexport);
<Triggers>
      <asp:PostBackTrigger ControlID="btnexport" />
</Triggers>