Asp. NET Refresh page Several methods of detailed _ practical skills

Source: Internet
Author: User
First type:
Copy Code code as follows:

private void Button1_Click (object sender, System.EventArgs e)
{
Response.Redirect (Request.Url.ToString ());
}

The second type:
Copy Code code as follows:

private void Button2_Click (object sender, System.EventArgs e)
{
Response.Write ("
<script language=javascript>window.location.href=document. URL;
</script> ");
}

The third type:
Copy Code code as follows:

private void Button3_Click (object sender, System.EventArgs e)
{
Response.AddHeader ("Refresh", "0");
}

The fourth kind:
Copy Code code as follows:

private void Button6_click (object sender, System.EventArgs e)
{
Like something's wrong?
Response.Write ("
<script language=javascript>window.location.reload ();
</script> ");
}

Fifth type: (need to replace <>)
Copy Code code as follows:

<script><!--
var limit= "3:00"
if (document.images)
{
var parselimit=limit.split (":") parselimit=parselimit[0]*60+parselimit[1]*1
}
function Beginrefresh ()
{
if (!document.images) returnif (parselimit==1) window.location.reload () Else
{
Parselimit-=1curmin=math.floor (PARSELIMIT/60) cursec=parselimit%60if (curmin!=0) curtime=curmin+ "cent" +cursec+ " Second, brush this page again! "elsecurtime=cursec+" seconds after the brush this page! "Window.status=curtimesettimeout (" Beginrefresh () ", 1000)
}
}
window.onload=beginrefresh//--> </script><div style= "z-index:102;
left:408px;
Position:absolute;
top:232px "ms_positioning=" text2d ">
<p><font size= "3" > Auto Refresh page </FONT></P>
</DIV>

The sixth kind:
Copy Code code as follows:

<meta http-equiv= "Refresh" content= "300;
Url=target.html ">

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.