locked
URL Routing e UpdatePanel problem RRS feed

  • Question

  • User205534147 posted

    After a day of exploration I give up. On a relatively simple website, I've set up the Ruoting URL that works regularly. Only problem: updatePanel goes to postBack and, from the searches I realized, the browser can not reach the resource file where there are the scripts ...

    I've tried them all but nothing. The strangest thing is that the same structure and configuration I have on another similar project that works regularly.

    The project is in webforms on IIS 7 in integrated mode.

    Can you help me?

    I therefore have this error:

    <script type="text/javascript">
    //<![CDATA[
    Sys.WebForms.PageRequestManager._initialize('ctl00$script11', 'aspnetForm', ['tctl00$contentmiddle$updatepronotazione','','tctl00$contentmiddle$updatemenu','','tctl00$contentmiddle$updaterecensioni',''], [], [], 90, 'ctl00');
    //]]> </script>
    Wednesday, November 1, 2017 10:31 AM

All replies

  • User-1838255255 posted

    Hi AngeloMietitore,

    According to your description, I am not clear your issue and what operations you do caused this issue. So I hope you could post your code and detailed description of your issue, this will be better help you solve the problem.

    Best Regards,

    Eric Du

    Thursday, November 2, 2017 9:24 AM
  • User205534147 posted

    Hi, I do not know what to send you. At first I had the scriptManager in the MasterPage and an UpdatePanel in a webform. Everything worked well. UpdatePanel worked asynchronously. Then I changed the global.asax to map the URLs and by what time UpdatePanel no longer work asynchronously but perform postBack reloading the page. I tried in the forums making various changes but nothing.

    Global.asax

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
            RegisterRoutes(RouteTable.Routes)
    end sub


    Sub RegisterRoutes(ByVal routes As RouteCollection) routes.MapPageRoute("404", "404", "~/404.aspx") 'etc... End Sub

    Web.config

    <?xml version="1.0"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=301880
      -->
    <!--
      Per ulteriori informazioni su come configurare l'applicazione ASP.NET, visitare il sito Web all'indirizzo
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    
      <system.web>
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" enableEventValidation="true"/>
        <compilation targetFramework="4.0" debug="true">
          <assemblies>
            <add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </assemblies>
        </compilation>
        <machineKey validationKey="7936F835A7F862E25C5EC13C3FA78FC2B88CF16408B10AE6E473668AE5CECC406AC6BD0E243394B41A673A91A5EB518FEA2510D89E63A110C682258ACD975700" decryptionKey="A415025B40FE0F9C081494F2467639AB20A20C3F04A4EA4C1310622D11889CC2" validation="SHA1" decryption="AES"/>
      </system.web>
      <system.web.extensions>
        <scripting>
          <scriptResourceHandler enableCompression="true" enableCaching="true"/>
        </scripting>
      </system.web.extensions>
      <location path="img_ico">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" setEtag="false"/>
          </staticContent>
        </system.webServer>
      </location>
      <location path="immagini">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" setEtag="false"/>
          </staticContent>
        </system.webServer>
      </location>
      <location path="css">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" setEtag="false"/>
          </staticContent>
        </system.webServer>
      </location>
      <location path="js">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" setEtag="false"/>
          </staticContent>
        </system.webServer>
      </location>
      <location path="img_progetti">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" setEtag="false"/>
          </staticContent>
        </system.webServer>
      </location>
      <location path="img_pillole">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" setEtag="false"/>
          </staticContent>
        </system.webServer>
      </location>
      <location path="loader">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" setEtag="false"/>
          </staticContent>
        </system.webServer>
      </location>
      <system.webServer>
        <!--<urlCompression doStaticCompression="true" doDynamicCompression="true" />-->
        <modules runAllManagedModulesForAllRequests="true"/>
        <defaultDocument enabled="true">
          <files>
            <clear/>
            <add value="coming.aspx"/>
          </files>
        </defaultDocument>
      </system.webServer>
      
      <system.webServer>
        <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
          <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
          <dynamicTypes>
            <add mimeType="text/*" enabled="true"/>
            <add mimeType="message/*" enabled="true"/>
            <add mimeType="application/javascript" enabled="true"/>
            <add mimeType="*/*" enabled="false"/>
          </dynamicTypes>
          <staticTypes>
            <add mimeType="text/*" enabled="true"/>
            <add mimeType="message/*" enabled="true"/>
            <add mimeType="application/javascript" enabled="true"/>
            <add mimeType="*/*" enabled="false"/>
          </staticTypes>
        </httpCompression>
      </system.webServer>
      <system.webServer>
        <httpErrors errorMode="Custom">
          <remove statusCode="404" subStatusCode="-1" />
          <error statusCode="404" subStatusCode="-1" prefixLanguageFilePath="" path="/404" responseMode="ExecuteURL" />
        </httpErrors>
      </system.webServer>
      <system.web>
        <httpRuntime requestValidationMode="2.0" maxRequestLength="10016" executionTimeout="300"/>
        
        
        <sessionState timeout="100"/>
        <caching>
          <outputCacheSettings>
            <outputCacheProfiles>
              <add name="AppCache1" enabled="true" duration="604800"/>
            </outputCacheProfiles>
          </outputCacheSettings>
        </caching>
      </system.web>
      <system.web>
        <globalization culture="it" uiCulture="it-IT"/>
      </system.web>
    </configuration>

    MasterPage

    <asp:ScriptManager ID="script11" runat="server">
        </asp:ScriptManager>

    WebForm Page

    <%@ Page Language="VB" Title="" MasterPageFile="firstmaster.master" CodeFile="locale.aspx.vb" Inherits="_locale" AutoEventWireup="false" %>
    <%@ import namespace="system.data"%>
    <%@ import namespace="system.data.SqlClient"%>
    
    
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
         
    </asp:Content>
    
    <asp:Content ID="Content2" ContentPlaceHolderID="contentmiddle" Runat="Server">
    <asp:UpdatePanel ID="updatepronotazione" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional" style="width:100%;">
    <ContentTemplate>
    <p><asp:button ID="buttonavanti1" runat="server"  cssClass="button1bisdisable" Text="Avanti" OnClick="vaibox3"/></p>
    </ContentTemplate>
    </asp:UpdatePanel>
    </asp:Content>
    
    

     

    Thursday, November 2, 2017 2:47 PM
  • User1738843376 posted

    Do you have any response.write instructions on your code behind? If so, that will break the UpdatePanel asynchronous behavior.

    Another this you must check is if you're using postbackurls on your buttons... if so, again, the asynchronous behavior goes don the drain. 

    Saturday, November 18, 2017 1:21 AM
  • User-1838255255 posted

    Hi AngeloMietitore,

    I have tested your posted code, I trigger click event, but nothing happen. You posted code seems not complete, so i hope you could post the complete code like click event code etc, and tell us what operation you do caused this issue, trigger button click event or other operation? More detailed description could help you reproduce and solve this problem. 

    Best Regards,
    Eric Du 

    Tuesday, November 21, 2017 9:49 AM