Re: Reload Page Command

From: Steven Cheng[MSFT] (v-schang_at_online.microsoft.com)
Date: 05/13/04


Date: Thu, 13 May 2004 03:42:49 GMT

Hi Alan,

Thanks for the followup. To answer your question:

1. I have no idea how to control the http-equiv = "refresh" meta of the
page

2. Of course ,we can use javascript code to post a page after a certain
period of time. The
window.setTimeout function is just for such function. For example:
We define the following function "setTimer()" and in it we add the
window.setTimeout("document.forms[0].submit()",1000);
which indicate that the page will be submit 1 second later after we call
this function.

<script language="javascript">
                                
function setTimer()
{
        window.setTimeout("document.forms[0].submit()",1000);
}
    
</script>

Then, we can call this function at the page's clientside's onload event,
just like:
<body onload="setTimer()" >

And if we want to control whether to call it or not at serverside. We can
use
Page.RegisterStartupScript method to programmatically add this script call,
just as below:

private void Page_Load(object sender, System.EventArgs e)
{
        Page.RegisterStartupScript("setTimer","<script
language='javascript'>setTimer();</script>");
}

Hope this helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx



Relevant Pages

  • HTC Components with > 512 bytes of javascript slow to unload
    ... When using large number of copies of a lightweight HTC behavior ... component to unload the page, ... If I shrink the javascript code below the 512 byte limit, ... The 512 byte limit only affects the contents of the <script ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Email obfuscation programs
    ... > script into your correct address ... then View Source in IE to see the javascript code they use. ... Tom Koch - MVP for Internet Explorer and Outlook Express ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Javascript Tutorial
    ... (JavaScript code goes in here) ... With regards to "older browsers that do not understand script" and the commenting of code. ... There are more but I stopped reading about 1/3rd through the page. ...
    (comp.lang.javascript)
  • RE: Adding MessageBox to my aspx page
    ... button Click event is linked to the javascript code (i.e. when will this ... add a hidden text box named txtHidden in .aspx file. ... private void btnClose_Click ... I've been trying to add a messagebox following the examples I've seen on the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using javascript confirm in .aspx
    ... No, then the script will return false, and nothing should happen. ... > head is spinning. ... > saw many examples of javascript code that is easy to understand and use, ...
    (microsoft.public.dotnet.languages.vb)

Loading