ASP.NET(C#)·µ»ØÉÏÒ»Ò³(ºóÍË)´úÂ루תÔØ£©
ASP.NET(C#)·µ»ØÉÏÒ»Ò³(ºóÍË)´úÂë
2008-08-10 10:32
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackUrl"] = Request.UrlReferrer.ToString();
}
}
/// <summary>
/// ·µ»Ø°´Å¥µã»÷ʼþ
/// </summary>
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect(ViewState["BackUrl"].ToString());
}
ÁíÒ»ÖÖ·½·¨
ÔÚC# Web³ÌÐòÖУ¬ÈçΪҳÃ水ťд·µ»ØÉÏÒ»Ò³´úÂë
this.RegisterClientScriptBlock("E", "<script language=javascript>history.go(-2);</script>");
ÆäÖУ¬history.go(-2)£¬ÒªÐ´Îª-2£¬ÒòÔÚ°´Å¥Ê¼þ´¥·¢Ç°£¬ÒÑË¢ÐÂÒ»´ÎÒ³Ã棬ËùÒÔÓ¦ÊÇ-2¡£
Response.Write("<script language=javascript>history.go(-2);</script>");
´Ë´¦Ò²ÒªÐ´Îª“-2”¡£¸úÖ±½Óд½Å±¾µÄÓÐËù²»Í¬¡£
Ïà¹ØÎĵµ£º
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Timers;
using System.Data;
using System.Data.SqlClient;
namespace SMS_joke
{
/// <summary>
/// Global µÄժҪ˵Ã÷¡£
/// </summary>
public class ......
Õû¸öSQLºÍAsp.net(vb.net)Ò»Æð´ò°üµÄÈ«¹ý³ÌдһÏ¡£
Ò».×¼±¸±ØÒªµÄÎļþ
1. SQL½Å±¾Îļþ£¬Éú³ÉÒÔºó°²×°¹ý³ÌÖÐÐèÒªµÄ±íºÍ´æ´¢¹ý³ÌµÈµÈ£»
Éú³ÉÖ®ºó£¬¾ÍÔÝʱ°ÑËüÃüÃûΪdb.sql(×¢Òâ´óСд)
2.LisenceFile.rtfµÄ°²×°Îļþ£¬ÒòΪÎÒµÄϵͳÊǸöÈ˵ģ¬¶øÇÒfreeµÄ£¬ËùÒÔ¾ÍûÓÐ×ö¡£Õâ¸öÒÔºóÒ²ÊÇÒªÓõ½µÄ¡£
¶þ.ÔÚ×Ô¼ºÏÖÓеÄÏîÄ¿Àïà ......
PRB£ºÔÚʹÓà Response.End¡¢Response.Redirect »ò Server.Transfer ʱ³öÏÖ ThreadAbortException
Ö¢×´
Èç¹ûʹÓà Response.End¡¢Response.Redirect »ò Server.Transfer ·½·¨£¬½«³öÏÖ ThreadAbortException Òì³£¡£Äú¿ÉÒÔʹÓà try-catch Óï¾ä²¶»ñ´ËÒì³£¡£
ÔÒò
Response.End ·½·¨ÖÕÖ¹Ò³µÄÖ´ÐУ¬²¢½«´ËÖ´ÐÐÇл»µ½Ó¦ÓóÌÐò ......