Periodic update of datagrid

Wolfseye

New Member
Hi,<BR><BR> I know you can set up a client-side script to trigger every xx seconds, but I need to trigger a server-side update. How can/should I do that?<BR><BR>Thanks,<BR>DeannaThis isn't asp.net hi-tek but it works.<BR>I can't think of any features in asp.net to trigger a client side refresh.<BR><BR>Step 1 Client side refresh<BR>------------------------------------------------------<BR>meta tag (note: quotes are supposed to be like that)<BR><META HTTP-EQUIV="Refresh" CONTENT="30; pageName.aspx?mode=update"><BR>-Or- javaScript<BR><script><BR> setTimeout("location.href=http://aspmessageboard.com/archive/index.php/'pageName.aspx?mode=update'",30000); //time in mS<BR></script><BR><BR>Step 2 Call Server Side Update<BR>---------------------------<BR>Note the url we were redirecting to had mode=update. <BR>Use this to trigger the update.<BR><%if request("mode") ="update" then update()%><BR>Or trigger the update on Page_Load event<BR><BR><BR><BR>Use the setTimeout method like xdrone said except use the __doPostBack() jscript call that asp.net generates. Or somehow submit the webform (form.submit()).. This will allow you to maintain the state of your asp.net page. <BR><BR>State in asp.net is stored in one hidden variable. As long as that keeps getting posted back to the server all your controls that have state will keep their state.
 
Back
Top