c# - UpdatePanel Timer Trigger not Working -


i trying timer trigger update updatepanel , cannot event fire. examples working basic , not sure need check bottom of this.

i have long running process(about hour) evaluates database content , picks out problematic rows. create page allows user execute process , see progress moves along. when problem rows found, want print info page user can see right away rather waiting task complete.

to thought use updatepanel had timer trigger every second. page accessed admins on private server traffic not concern. not sure best approach, if there way of approaching task should consider, please feel free suggest.

to test concept started example @ updatepanel timer causes panels update. modified things suggested , came code appears below.

when execute code, can select drop down option , second updatepanel update timer never executes. have placed break point on timer1_tick function doesn't hit.

i observed when select item drop down, page_load hit. wasn't expecting function hit when 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 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 using visual studio 2010 asp.net 4.0.
have tested localhost , 127.0.0.1 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> 

i got bottom of one. in end, came down settings in web.config file.

1 source of confusion test project created didn't need of in web.config file. non-test project more complicated , must have settings cause these additional lines required. curious exact settings cause required, if knows, helpful add discussion.

adding following entries in web.config file corrected situation , allowed updatepanel 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 below 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 added here -->     </modules>   </system.webserver> 

here link question helpful while troubleshooting in case running same problem: sys undefined

thank posted comments, helpful in keeping me going , making sure troubleshooting correct locations.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -