当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > ASP.NET刷新页面的六种方法

ASP.NET
Web服务器控件:LinkButton控件
Web服务器控件:ListBox控件
Web服务器控件:ListItem控件
Web服务器控件:Literal控件
Web服务器控件:Panel控件
Web服务器控件:PlaceHolder控件
Web服务器控件:RadioButton控件
Web服务器控件:RadioButtonList控件
Web服务器控件:BulletedList控件
Web服务器控件:Style控件
Web服务器控件:Table控件
Web服务器控件:TableCell控件
Web服务器控件:TableRow控件
Web服务器控件:TextBox控件
Web服务器控件:XML控件
Validation服务器控件:CompareValidator控件
Validation服务器控件:CustomValidator控件
Validation服务器控件:RangeValidator控件
Validation服务器控件:RegularExpressionValidator控件
Validation服务器控件:RequiredFieldValidator控件

ASP.NET刷新页面的六种方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 207 ::
收藏到网摘: n/a

第一:


第二:

以下为引用的内容:

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. style="Z-INDEX: 102;
LEFT: 408px;
POSITION: absolute;
TOP: 232px" ms_positioning="text2D">
<P><FONT size="3">自动刷新页面</FONT></P>
</DIV>

第六:

以下为引用的内容:

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