2

I am trying to get a Timer to trigger an update to an UpdatePanel and cannot get the event to fire. The examples I am working with are very basic and I am not sure what I need to check to get to the bottom of this.

I have a long running process(about an hour) that evaluates database content and picks out problematic rows. I would like to create a page that allows the user to execute the process and see the progress as it moves along. When problem rows are found, I want to print that info to the page so the user can see it right away rather than waiting for the task to complete.

To do this I thought I would use an UpdatePanel that had a Timer trigger every second. This page will only be accessed by admins on a private server so traffic is not a concern. I am not sure that this is the best approach, so if there is another way of approaching this task that I should consider, please feel free to suggest.

To test the concept I started with the example at UpdatePanel Timer causes all panels to update. I modified things as suggested and came up with the code that appears below.

When I execute the code, I can select a drop down option and get the second UpdatePanel to update but the Timer never executes. I have placed a break point on the Timer1_Tick function but it doesn't get hit.

I also observed that when I select an item from the drop down, Page_Load is hit. I wasn't expecting this function to be hit when the update, should it?

ASPX File:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MissingTitles2.aspx.cs" Inherits="TestCode_AJAX_MissingTitles2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
 <form id="form1" runat="server">
<div>
    <asp:Label runat="server" ID="NoChangeLabel"></asp:Label>
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Label ID="Label1" runat="server" Text="not updated yet"></asp:Label>
            <asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick"></asp:Timer>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
        </Triggers>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Label ID="Label2" runat="server" Text="also not updated yet"></asp:Label>
    <br />
    <br />
    <asp:DropDownList  OnSelectedIndexChanged="dropDown_indexChange" ID="DropDownList1" runat="server" AutoPostBack="True">
        <asp:ListItem>This</asp:ListItem>
        <asp:ListItem>That</asp:ListItem>
        <asp:ListItem>The Other</asp:ListItem>
    </asp:DropDownList>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="DropDownList1"  EventName="SelectedIndexChanged" />
        </Triggers>
    </asp:UpdatePanel>
</div>
</form>
</body>
</html>

Here is the ASPX.CS file:

using System;

public partial class TestCode_AJAX_MissingTitles2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        NoChangeLabel.Text = "Current time: " + DateTime.Now.ToLongTimeString();
    }

    protected void Timer1_Tick(object sender, EventArgs e)
    {
        Label1.Text = "UpdatePanel1 refreshed at: " +
      DateTime.Now.ToLongTimeString();

    }

    protected void dropDown_indexChange(object sender, EventArgs e)
    {
        Label2.Text = "UpdatePanel2 refreshed at: " +
          DateTime.Now.ToLongTimeString();
    }
}

I am using Visual Studio 2010 with ASP.NET 4.0.
I am have tested with localhost and 127.0.0.1 as the domain.

Web.Config Excerpts:

<system.web>
    <webParts>
      <personalization defaultProvider="EktronPersonalizationProvider">
        <providers>
          <add connectionStringName="Ektron.DbConnection" name="EktronPersonalizationProvider" type="Ektron.Cms.EktronPersonalizationProvider"/>
        </providers>
        <authorization>
          <allow users="*" verbs="enterSharedScope"/>
          <allow users="*" verbs="modifyState"/>
        </authorization>
      </personalization>
    </webParts>
    <membership defaultProvider="EktronMembershipProvider">
      <providers>
        <remove name="AspNetSqlProvider"/>
        <add name="EktronMembershipProvider" type="Ektron.Cms.EktronMembershipProvider" connectionStringName="Ektron.DbConnection"/>
      </providers>
    </membership>
    <compilation debug="true" targetFramework="4.0">
      <buildProviders>
        <add extension=".htm" type="System.Web.Compilation.PageBuildProvider"/>
        <add extension=".html" type="System.Web.Compilation.PageBuildProvider"/>
      </buildProviders>
      <codeSubDirectories>
        <add directoryName="CSCode"/>
        <add directoryName="VBCode"/>
      </codeSubDirectories>
      <assemblies>
        <add assembly="System.DirectoryServices,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Security,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Management,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Configuration.Install,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.ServiceProcess,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Messaging,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Runtime.Remoting,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B77A5C561934E089"/>
        <add assembly="Microsoft.VisualBasic.Compatibility,Version=10.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Design,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="Microsoft.VisualBasic,Version=10.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Data.DataSetExtensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.ComponentModel.Composition,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <caching>
      <outputCacheSettings>
        <outputCacheProfiles>
          <add name="PageLevelCaching" duration="120" varyByCustom="IsLoggedIn" varyByParam="*" location="Server"/>
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>
    <pages clientIDMode="AutoID" controlRenderingCompatibilityVersion="3.5" validateRequest="false">
      <controls>
        <add tagPrefix="ektronUI" namespace="Ektron.Cms.Framework.UI.Controls.EktronUI" assembly="Ektron.Cms.Framework.UI.Controls.EktronUI, Culture=neutral, PublicKeyToken=559a2c4fa21e63be"/>
        <add tagPrefix="ektron" namespace="Ektron.Cms.Framework.UI.Controls" assembly="Ektron.Cms.Framework.UI.Controls, Culture=neutral, PublicKeyToken=559a2c4fa21e63be"/>
        <add tagPrefix="ektron" namespace="Ektron.Cms.Framework.UI.Controls.Views" assembly="Ektron.Cms.Framework.UI.Controls, Culture=neutral, PublicKeyToken=559a2c4fa21e63be"/>
      </controls>
      <namespaces>
        <clear/>
        <add namespace="System"/>
        <add namespace="System.Collections"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="System.Collections.Specialized"/>
        <add namespace="System.Configuration"/>
        <add namespace="System.Text"/>
        <add namespace="System.Text.RegularExpressions"/>
        <add namespace="System.Linq"/>
        <add namespace="System.Xml.Linq"/>
        <add namespace="System.Web"/>
        <add namespace="System.Web.Caching"/>
        <add namespace="System.Web.SessionState"/>
        <add namespace="System.Web.Security"/>
        <add namespace="System.Web.Profile"/>
        <add namespace="System.Web.UI"/>
        <add namespace="System.Web.UI.WebControls"/>
        <add namespace="System.Web.UI.WebControls.WebParts"/>
        <add namespace="System.Web.UI.HtmlControls"/>
      </namespaces>
    </pages>
    <customErrors mode="Off"/>
    <authentication mode="Forms">
      <forms cookieless="UseCookies"/>
    </authentication>
    <identity impersonate="false" userName="" password=""/>
    <authorization>
      <allow users="*"/>
    </authorization>
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>
    <httpRuntime maxRequestLength="2097151" requestLengthDiskThreshold="2097151" requestValidationMode="2.0"/>
  </system.web>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <clear/>
      <add name="WebServiceHandlerFactory-Integrated" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode"/>
      <add name="rules-Integrated" path="*.rules" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode"/>
      <add name="rules-ISAPI-2.0" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
      <add name="rules-64-ISAPI-2.0" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64"/>
      <add name="xoml-Integrated" path="*.xoml" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode"/>
      <add name="xoml-ISAPI-2.0" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
      <add name="xoml-64-ISAPI-2.0" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64"/>
      <add name="ISAPI-dll" path="*.dll" verb="*" modules="IsapiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true"/>
      <add name="TraceHandler-Integrated" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" preCondition="integratedMode"/>
      <add name="WebAdminHandler-Integrated" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" preCondition="integratedMode"/>
      <add name="AssemblyResourceLoader-Integrated" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode"/>
      <add name="WorkareaHandler" path="*/WorkArea/ContentDesigner/configurations/*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode"/>
      <add name="PageHandlerFactory-Integrated" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode"/>
      <add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.SimpleHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode"/>
      <add name="HttpRemotingHandlerFactory-rem-Integrated" path="*.rem" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode"/>
      <add name="HttpRemotingHandlerFactory-soap-Integrated" path="*.soap" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode"/>
      <add name="AboMapperCustom-4879914" path="*.htw" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="C:\Windows\system32\webhits.dll" requireAccess="Script" responseBufferLimit="0"/>
      <add name="AboMapperCustom-4879915" path="*.ida" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="C:\Windows\system32\idq.dll" resourceType="File" requireAccess="Script" responseBufferLimit="0"/>
      <add name="AboMapperCustom-4879916" path="*.idq" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="C:\Windows\system32\idq.dll" resourceType="File" requireAccess="Script" responseBufferLimit="0"/>
      <add name="EktronWorkflowImage" path="*/wfactivities.png" verb="*" type="Ektron.Workflow.Image.Handler.WFImageHandler,Ektron.Workflow.Image"/>
      <add name="AXD-ISAPI-2.0-64" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0"/>
      <add name="PageHandlerFactory-ISAPI-2.0-64" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0"/>
      <add name="SimpleHandlerFactory-ISAPI-2.0-64" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0"/>
      <add name="WebServiceHandlerFactory-ISAPI-2.0-64" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0"/>
      <add name="HttpRemotingHandlerFactory-rem-ISAPI-2.0-64" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0"/>
      <add name="HttpRemotingHandlerFactory-soap-ISAPI-2.0-64" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0"/>
      <add name="AXD-ISAPI-2.0" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0"/>
      <add name="PageHandlerFactory-ISAPI-2.0" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0"/>
      <add name="SimpleHandlerFactory-ISAPI-2.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0"/>
      <add name="WebServiceHandlerFactory-ISAPI-2.0" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0"/>
      <add name="HttpRemotingHandlerFactory-rem-ISAPI-2.0" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0"/>
      <add name="HttpRemotingHandlerFactory-soap-ISAPI-2.0" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0"/>
      <add name="TRACEVerbHandler" path="*" verb="TRACE" modules="ProtocolSupportModule" requireAccess="None"/>
      <add name="ek*" path="*" verb="GET,HEAD,POST" type="Ektron.ASM.EkHttpDavHandler.EkDavHttpHandlerFactory" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" preCondition=""/>
      <add name="ekdav" path="*" verb="OPTIONS,PROPFIND,PUT,LOCK,UNLOCK,MOVE,COPY,GETLIB,PROPPATCH,MKCOL,DELETE,(GETSOURCE),(HEADSOURCE),(POSTSOURCE)" type="Ektron.ASM.EkHttpDavHandler.EkDavHttpHandlerFactory" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" preCondition=""/>
      <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read"/>


    </handlers>
    <modules>
      <add name="MyDigestAuthenticationModule" type="Ektron.ASM.EkHttpDavHandler.Security.DigestAuthenticationModule,Ektron.ASM.EkHttpDavHandler"/>
      <add name="EkUrlAliasModule" type="Ektron.Cms.Settings.UrlAliasing.URLAliasingModule" preCondition="integratedMode"/>
      <add name="EkUrlRedirectModule" type="Ektron.Cms.Settings.UrlAliasing.URLRedirectModule" preCondition="integratedMode"/>
      <add name="EkMobileDeviceModule" type="Ektron.Cms.Settings.UrlAliasing.MobileDeviceModule" preCondition="integratedMode"/>
      <add name="EkAssetServerModule" type="EktronAssetServerModule" preCondition="integratedMode"/>
      <add name="EkHelpModule" type="HelpModule" preCondition="integratedMode"/>
    </modules>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147483648"/>
      </requestFiltering>
    </security>
    <caching>
      <profiles>
        <add extension=".xslt" policy="DontCache" kernelCachePolicy="DontCache"/>
        <add extension=".xsl" policy="DontCache" kernelCachePolicy="DontCache"/>
        <add extension=".aspx.cs" policy="DontCache" kernelCachePolicy="DontCache"/>
      </profiles>
    </caching>
  </system.webServer>
Cœur
  • 37,241
  • 25
  • 195
  • 267
RacerNerd
  • 1,579
  • 1
  • 13
  • 31
  • Another example I have tested is at http://msdn.microsoft.com/en-us/library/bb398865%28v=vs.90%29.aspx. When I test the example there without modification, the content is not updated. Is there some configuration I need to look into? – RacerNerd Apr 04 '13 at 23:04
  • try moving the timer outside the updatepanel, see http://encosia.com/aspnet-ajax-timer-trouble-location-is-key/ – Filip Apr 04 '13 at 23:09
  • I'm unsure about this, but do you need the timer tick event as a trigger? I thought that if a control inside an update panel causes a post back then a trigger was not required. Might be worth a try. – Jack Pettinger Apr 04 '13 at 23:10
  • I reviewed the link Filip sent. This article describes that the timing may be off if you place the timer in different locations. My problem is that no matter where I place the trigger, the associated tick function is not executed. I tried the simple example in the conclusion of the article and it would not function as expected. – RacerNerd Apr 05 '13 at 00:01
  • I tested based on Jack's comment. I removed the Trigger for the first update panel and it didn't cause anything different to happen. The example from Filip's comment doesn't have a triggers section defined and is much more simple. I couldn't get it to work. – RacerNerd Apr 05 '13 at 00:05
  • 1
    I tried your sample and it worked perfectly fine for me, weird. Cant see anything wrong that you are doing – Guru Kara Apr 05 '13 at 02:54
  • 1
    This sample works perfectly fine for me also! – Sanjeev Rai Apr 05 '13 at 08:45
  • 1
    is this all of the code? no master page etc. ? – Filip Apr 05 '13 at 10:09
  • Thanks for looking at this. This is the complete code. I wanted to use this in a page with a master page but I have backed things out to the simplest example possible. This was added as page to an existing web site so maybe there are configuration issues. Visual Studio Intellisense works on all the objects and I don't see any errors in Visual Studio or in the browser window. I think I am going to try it in a new project to see what happens as a next step. – RacerNerd Apr 05 '13 at 16:12
  • I carried out a couple more tests. I created a couple new projects, one a web application and another a web site in VS 2010. I added my sample code and everything worked in both cases. This really takes me back to thinking that there is some sort of a configuration issue. When testing in the non-working environment, selecting an item in the drop down causes a full page refresh instead of a partial page refresh. What would cause UpdatePanel to return a full page reload instead of a partial page reload? Is there some configuration settings I need to look at? – RacerNerd Apr 05 '13 at 22:05
  • Another data point. I moved this up to a development server to test that it was not a configuration issue linked to the site on my machine. The UpdatePanel didn't work as expected on the development server either. If it is a configuration problem it is shared between my sites leading me to think it's in the web.config... but where? – RacerNerd Apr 06 '13 at 00:11
  • 1
    want to post your web.config? – Filip Apr 07 '13 at 09:50
  • 1
    I am definitely willing to post my web.config file but the thing is too long. I have stripped down the file quite a bit already and it is still almost 70,000 characters. There is a 30,000 character limit here. I am picking a couple pieces to post but don't know exactly what we are looking for so if another section is needed, let me know. – RacerNerd Apr 08 '13 at 16:54
  • For the record, I have checked to confirm that does not exist in the web.config file. – RacerNerd Apr 08 '13 at 17:01
  • 1
    Check your browser and make sure you aren't getting any JavaScript errors – Icemanind Apr 08 '13 at 18:17
  • Thanks for that tip. I am seeing a JavaScript error. Here is my JavaScript Error: "ASP.NET Ajax client-side framework failed to load." This seems consistent with the behavior I am seeing where a partial page post would revert back to a full page postback if AJAX wasn't enabled. I am looking into this error message but any tips are appreciated. Thanks. – RacerNerd Apr 08 '13 at 20:26
  • I am able to debug and break at the Application_Error function in global.asax. It appears to be requesting ScriptResource.axd when the breakpoint is hit. – RacerNerd Apr 08 '13 at 20:49
  • I have been through a ton of pages talking about the message I mention above. So far I haven't been able to get any of the solutions on these sites to work. My next planned step is to remove entries in the web.config file to see if anything is interfering. – RacerNerd Apr 09 '13 at 16:32
  • I didn't end up removing things as a troubleshooting step. The next step can be read in the answer. – RacerNerd Apr 19 '13 at 20:36

1 Answers1

0

I finally got to the bottom of this one. In the end, this came down to settings in the web.config file.

One source of confusion was that the test project I created didn't need any of this in the web.config file. The non-test project is much more complicated and must have settings that cause these additional lines to be required. I am curious about the exact settings that cause this to be required, so if anyone knows, that would be helpful to add to the discussion.

Adding the following entries in the web.config file corrected the situation and allowed the UpdatePanel to function:

    <system.webServer>
    <handlers>
      <clear />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <!-- Make sure wildcard rules are below the ScriptResource tag -->
    </handlers>
    <modules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <!-- Other modules are added here -->
    </modules>
  </system.webServer>

Here is a link to a question that was helpful while troubleshooting in case anyone is running into the same problem: Sys is undefined

Thank you to everyone who posted comments, they were very helpful in keeping me going and making sure I was troubleshooting the correct locations.

Community
  • 1
  • 1
RacerNerd
  • 1,579
  • 1
  • 13
  • 31