页面返回

 

  /// <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);
        }

posted @ 2010-04-23 18:05  StarWang  阅读(213)  评论(0编辑  收藏  举报