asp.net刷新本页面的六种方法总结

第一:
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( "
    <script language=javascript>window.location.href=document.URL;
    </script>" );
}

第三:
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 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. ms_positioning="text2D">
<P><FONT size="3">自动刷新页面</FONT></P>
</DIV>

第六:
<meta http-equiv="refresh" content="300;
url=target.html">

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdwwyp.html