zoukankan      html  css  js  c++  java
  • Server.Transfer和返回上一页

    页面一

    publicstring name
    {
    get
    {
    returnthis.TextBox1.Text;
    }
    }
    publicstring EMail
    {
    get
    {
    returnthis.TextBox2.Text;
    }
    }

    protectedvoid Button1_Click(object sender, EventArgs e)
    {
    Context.Items.Add(
    "name", name);
    Context.Items.Add(
    "EMail", EMail);
    Server.Transfer(
    "WebForm2.aspx");
    }

    跳转后的页面

    Response.Write(Context.Items["name"].ToString() + Context.Items["EMail"].ToString());

    2:cs端返回上一页

    获取页面地址存入ViewState

       步骤一: ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();

     步骤二: Response.Redirect((String)ViewState["UrlReferrer"]);

  • 相关阅读:
    第四章5
    第四章4
    第四章3
    第四章2
    第四章1
    第四章例4-8
    第四章例4-7
    第四章例4-6
    第四章例4-5
    第四章例4-4
  • 原文地址:https://www.cnblogs.com/happygx/p/2088827.html
Copyright © 2011-2022 走看看