ASP.NETページをリフレッシュするいくつかの方法の詳細

2123 ワード

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

2つ目:
 
  
private void Button2_Click( object sender, System.EventArgs e )  
{
    Response.Write( "
    window.location.href=document.URL; <br>    " );
}

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

4つ目:
 
  
private void Button6_Click( object sender, System.EventArgs e )  
{
    // ?
    //Response.Write( "
    window.location.reload( ); <br>    " );
}

5つ目:(置換する必要がある<>)
 
  
<!-- <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.onload=beginrefresh//--> 




6つ目: