zoukankan      html  css  js  c++  java
  • 页面返回

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

  • 相关阅读:
    异常
    带参数的方法
    变量,基本类型,数据类型和运算符
    数据类型转换(针对数字类型)
    this关键字
    面向对象DAO模式
    常见类 Object
    方法和包
    final关键字
    abstract关键字
  • 原文地址:https://www.cnblogs.com/KingStar/p/1718843.html
Copyright © 2011-2022 走看看