Maison > Article > interface Web > asp.net刷新本页面的六种方法总结_javascript技巧
第一:
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Redirect( Request.Url.ToString( ) );
}
第二:
private void Button2_Click( object sender, System.EventArgs e )
{
Response.Write( "
" );
}
第三:
private void Button3_Click( object sender, System.EventArgs e )
{
Response.AddHeader( "Refresh","0" );
}
第四:
private void Button6_Click( object sender, System.EventArgs e )
{
//好像有些不对?
//Response.Write( "
" );
}
第五:(需替换)
<script><!-- <BR>var limit="3:00" <BR>if ( document.images ) <BR>{ <BR> var parselimit=limit.split( ":" )parselimit=parselimit[0]*60+parselimit[1]*1 <BR>} <BR>function beginrefresh( ) <BR>{ <BR> if ( !document.images )returnif ( parselimit==1 )window.location.reload( )else <BR> { <BR> parselimit-=1curmin=Math.floor( parselimit/60 )cursec=parselimit% 60if ( curmin!=0 )curtime=curmin+"分"+cursec+"秒后重刷本页!"elsecurtime=cursec+ "秒后重刷本页!"window.status=curtimesetTimeout( "beginrefresh( )",1000 ) <BR> } <BR>} <BR>window. style="Z-INDEX: 102; <BR>LEFT: 408px; <BR>POSITION: absolute; <BR>TOP: 232px" ms_positioning="text2D"> <BR><P><FONT size="3">自动刷新页面</script>
第六: