页面返回
/// <summary>
/// 获得上一页面的URL
/// </summary>
public string EnterURL
{
get
{
object oEnterURL = this.ViewState["oEnterURL"];
return oEnterURL == null ? string.Empty : (string)oEnterURL;
}
set
{
this.ViewState["oEnterURL"] = value;
}
}
页面加载:
if (!IsPostBack)
{
this.EnterURL = this.Request.UrlReferrer.PathAndQuery;
}
返回:
/// <summary>
/// 返回
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReturn_Click(object sender, System.EventArgs e)
{
Response.Redirect(EnterURL);
}