Updated ASP.NET 3.5 to 4.0 & # 8594; Sys.WebForms.PageRequestManager undefined

As the name implies, I recently updated an ASP.NET 3.5 application that contains UpdatePanels and similar AJAX technologies for ASP.NET 4.0. Unfortunately, UpdatePanels no longer work, and pop-up return pages completely go south.

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>

JavaScript error after execution in Chrome:

Uncaught TypeError: Object function Function() { [native code] } has no method '_registerScript'
Uncaught TypeError: Cannot read property 'PageRequestManager' of undefined

What could I do wrong? Thank!

+5
source share
4 answers

... and I myself solved this by replacing UpdatePanels and removing script managers.

0
source

, , . , web.config, .

:

<xhtmlConformance mode="Legacy"/>

<xhtmlConformance mode="Transitional"/>
+4

EnablePartialRendering="false" ScriptManager

+3

, , , , . , .

EnablePartialRendering = "false" ScriptManager

, , . , Page_Load(). btnexport - .

ScriptManager.GetCurrent(Page).RegisterPostBackControl(btnexport);

At first I tried it outside the postback, but my requirements were to export even after every drop-down that was on the update panel, so the button did not work for this. then when i put it in the postback ... voila !! It worked like a charm. This way, you can put it outside or inside the postback according to your requirements.

OR

Another solution - you can do this-

You may have forgotten to add a trigger inside asp: updatepanel, like me. Add this inside updatepanel and voila!

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

All Articles