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”¡£¸úÖ±½Óд½Å±¾µÄÓÐËù²»Í¬¡£
Ïà¹ØÎĵµ£º
ÔÚʹÓÃAJAX½øÐгÌÐò¿ª·¢µÄʱºò£¬Ò»Ö±¶¼»áÃæ¶ÔÒ»¸ö»º´æµÄÎÊÌ⣡£¡
¼´ÊÇ£¬ÉÏ´ÎÇëÇóµÄʱºò£¬ÒòΪÄãµÄSQLÓï¾ä»òÕßÆäËûÔÒò£¬webserviceÖзµ»ØֵΪ¿Õ£¬²»ÊÇÄãÏëÒªµÄ½á¹û¼¯£¬ÔÚÄã·¢ÏÖwebserviceÖÐÓï¾äÌå³ö´íºó£¬½øÐÐÐ޸ģ¬ÖØвâÊÔ£¬ÈÔÈ»ÊÇÉϴεķµ»Ø½á¹û£¡¸Ð¾õ¾ÍÏñÄãµÄÐÞ¸ÄÍêÈ«ÎÞЧ¡£¡£
Æäʵ£¬ÕâÊÇÔÚAJAXµ ......
ÔÚasp.netÀïÃ棬ºÜ¶àʱºòʹÓÃsessionÀ´±£´æһЩ¶ÔÏ󣬱ÈÈç˵¹ºÎï³µµÈµÈ£¬Óкܶàʱºò£¬¾ÍËãÄãÉèÖÃÁËsession³¬Ê±µÄʱ¼ä£¬session»¹ÊÇ»áÎÞÔµÎ޹ʵĶªÊ§£¬ÕâÀïÓÐÒ»ÖֱȽϼòµ¥µÄ·½·¨¿ÉÒÔÉèÖÃsession¶ªÊ§µÄʱ¼ä¡£
ÔÚweb.configÀïÃæÈçÏÂÅäÖÃ
<sessionState
& ......
Asp.net ×Ô¶¯·¢ËÍÓʼþµÄ·½·¨
½ñÌìÓÐÒ»¸öÄ£¿éÐèÒª×Ô¶¯·¢ËÍÓʼþµÄ¹¦ÄÜ£¬¾ÍËæ±ãдÁËÒ»¸ö£¬¼Ç¼һÏÂ×÷Ϊ»ýÀÛ¡£
Ò»¡¢Ê×ÏÈÐèÒªÅäÖÃweb.configÎļþ£º
<system.net>
<mailSettings>
<smtp from="Emailname">
<network ho ......
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 ......