asp.net页面刷新重是有问题,收藏几种方法挺有用的.
一、
Reqponse
型
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Redirect( Request.Url.ToString( ) );
}
private void Button1_Click( object sender, System.EventArgs e )
{
Response.AddHeader( "Refresh","0" );
}
二、JS型
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Write( "
<script language=javascript>window.location.href=document.URL;
</script>" );
}
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Write( "
<script language=javascript>window.location.reload( );
</script>" );
}
<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+"分"+cursec+"秒后重刷本页!"elsecurtime=cursec+"秒后重刷本页!"window.status=curtimesetTimeout( "beginrefresh( )",1000 )
}
}
window.οnlοad=beginrefresh//--> </script><DIV style="Z-INDEX: 102; LEFT: 408px;
POSITION: absolute;
TOP: 232px" ms_positioning="text2D">
<P><FONT size="3">自动刷新页面</FONT></P>
三、HTML型
<meta http-equiv="refresh" content="300;
url=target.html">