ASP.NETÒ³Ãæˢз½·¨´ó¼¯ºÏ
ÏÈ¿´¿´ASP.NETÒ³ÃæˢеÄʵÏÖ·½·¨£º
¡¡¡¡µÚÒ»£º
¡¡¡¡C# code
¡¡¡¡private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); }
¡¡¡¡µÚ¶þ£º
¡¡¡¡C# code
¡¡¡¡private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.location.href=document.URL; < /script>" ); }
¡¡¡¡µÚÈý£º
¡¡¡¡C# code
¡¡¡¡private void Button3_Click( object sender, System.EventArgs e ) { Response.AddHeader( "Refresh","0" ); }
¡¡¡¡µÚËÄ£º
¡¡¡¡C# code
¡¡¡¡private void Button6_Click( object sender, System.EventArgs e ) { //ºÃÏñÓÐЩ²»¶Ô£¿ //Response.Write( " < script language=javascript>window.location.reload( ); < /script>" ); }
¡¡¡¡µÚÎ壺
¡¡¡¡HTML code
¡¡¡¡< 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.onload=beginrefresh//--> < /script>< DIV 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"> ÓÃwindow.location.hrefʵÏÖË¢ÐÂÁí¸ö¿ò¼ÜÒ³Ãæ
¡¡¡¡ÔÚдasp.net³ÌÐòµÄʱºò£¬ÎÒÃǾ³£Óöµ½ÌøתҳÃæµÄÎÊÌ⣬ÎÒÃǾ³£Ê¹ÓÃResponse.Redirect £¬Èç¹û¿Í»§ÒªÔÚÌøתµÄʱºòʹÓÃÌáʾ£¬Õâ¸ö¾Í²»Áé¹âÁË£¬È磺
¡¡¡¡Response.Write(" < script>alert('¹§Ï²Äú£¬×¢²á³É¹¦£¡'); < /script>"); Response.Redirect("main.html"); ÕâʱºòÎÒÃǵÄÌáʾÄÚÈÝûÓгöÀ´¾ÍÌøתÁË£¬ºÍResponse.Redirect("main.html"); ûÓÐÈκÎÇø±ð¡£
¡¡¡¡ÕâʱÎÒÃDzÉÓÃÏÂÃæ´úÂëÊÔÑéÒ»Ï
Ïà¹ØÎĵµ£º
ÔÚʹÓÃAJAX½øÐгÌÐò¿ª·¢µÄʱºò£¬Ò»Ö±¶¼»áÃæ¶ÔÒ»¸ö»º´æµÄÎÊÌ⣡£¡
¼´ÊÇ£¬ÉÏ´ÎÇëÇóµÄʱºò£¬ÒòΪÄãµÄSQLÓï¾ä»òÕßÆäËûÔÒò£¬webserviceÖзµ»ØֵΪ¿Õ£¬²»ÊÇÄãÏëÒªµÄ½á¹û¼¯£¬ÔÚÄã·¢ÏÖwebserviceÖÐÓï¾äÌå³ö´íºó£¬½øÐÐÐ޸ģ¬ÖØвâÊÔ£¬ÈÔÈ»ÊÇÉϴεķµ»Ø½á¹û£¡¸Ð¾õ¾ÍÏñÄãµÄÐÞ¸ÄÍêÈ«ÎÞЧ¡£¡£
Æäʵ£¬ÕâÊÇÔÚAJAXµ ......
ÔÚasp.netÀïÃ棬ºÜ¶àʱºòʹÓÃsessionÀ´±£´æһЩ¶ÔÏ󣬱ÈÈç˵¹ºÎï³µµÈµÈ£¬Óкܶàʱºò£¬¾ÍËãÄãÉèÖÃÁËsession³¬Ê±µÄʱ¼ä£¬session»¹ÊÇ»áÎÞÔµÎ޹ʵĶªÊ§£¬ÕâÀïÓÐÒ»ÖֱȽϼòµ¥µÄ·½·¨¿ÉÒÔÉèÖÃsession¶ªÊ§µÄʱ¼ä¡£
ÔÚweb.configÀïÃæÈçÏÂÅäÖÃ
<sessionState
& ......
/// <summary>
/// ¹ýÂ˱ê¼Ç
/// </summary>
/// <param name="NoHTML">°üÀ¨HTML£¬½Å±¾£¬Êý¾Ý¿â¹Ø¼ü×Ö£¬ÌØÊâ×Ö·ûµÄÔ´Âë </param>
/// <returns>ÒѾȥ³ý±ê¼ÇºóµÄÎÄ×Ö</returns>
&nbs ......
ÔÚweb¿ª·¢ÖÐ,¾³£ÒªÓõ½¿Ø¼þµÄOnClientClickÓëOnClickʼþ.
Èç¹ûʹÓò»µ±,¾³£»áÓöµ½Ò»Ð©ÒâÁÏÖ®ÍâµÄÊÂÇé·¢Éú,ÈÃÈËÃþ²»×ÅÍ·ÄÔ.ÏÂÃæ¾Í½«ÎÒµÄһЩСС×ܽáµÀÀ´:
Ê×ÏÈÎÒÃÇÒªÁ˽âÕâÁ½¸öʼþ:
OnClientClickÊÇ¿Í»§¶Ëʼþ·½·¨.Ò»°ã²ÉÓÃJavaScriptÀ´½øÐд¦Àí.Ò²¾ÍÊÇÖ±½ÓÔÚIE¶ËÔËÐÐ.Ò»µã»÷¾ÍÔËÐÐ.
OnClickʼþÊÇ·þÎñÆ÷¶Ëʼþ´¦Àí ......
ASP.NET(C#)·µ»ØÉÏÒ»Ò³(ºóÍË)´úÂë
2008-08-10 10:32
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackUrl"] = Request.UrlReferrer.ToString();
}
}
/// <s ......