天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

2個頁面間不通過Session與url的傳值方式

下面是全部代碼,已經編譯通過。
Chuandi(傳遞)是名字空間

WebForm1:
<%@ Page language="c#" Codebehind="WebForm1.ASPx.cs" Inherits="chuandi.WebForm1" %>
<HTML>
 <HEAD>
  <title>WebForm1</title>
 </HEAD>
 <body>
  <form id="Form1" method="post" runat="server">
   <ASP:TextBox id="TextBox1" runat="server"></ASP:TextBox>
   <ASP:Button id="Button1" runat="server" Text="傳"></ASP:Button>
  </form>
 </body>
</HTML>
using System;
namespace chuandi
{
 public class WebForm1 : System.Web.UI.Page
 {
  protected System.Web.UI.WebControls.TextBox TextBox1;
  protected System.Web.UI.WebControls.Button Button1;
  public string Text1
  {
   get
   {
    return this.TextBox1.Text;
   }
  }
  private void Page_Load(object sender, System.EventArgs e)
  {}
  override protected void OnInit(EventArgs e)
  {
   InitializeComponent();
   base.OnInit(e);
  }
  private void InitializeComponent()
  {   
   this.Button1.Click += new System.EventHandler(this.Button1_Click);
   this.Load += new System.EventHandler(this.Page_Load);
  }
  private void Button1_Click(object sender, System.EventArgs e)
  {
   Server.Transfer("WebForm2.ASPx");
  }
 }
}


WebForm2:
<%@ Page language="c#" Codebehind="WebForm2.ASPx.cs" Inherits="chuandi.WebForm2" %>
<%@ Reference Page="WebForm1.ASPx" %>
<HTML>
 <HEAD>
  <title>WebForm2</title>
 </HEAD>
 <body>
  <form id="Form1" method="post" runat="server">
   <ASP:Label id="Label1" runat="server">Label</ASP:Label>
   <ASP:Button id="Button1" runat="server" Text="返回"></ASP:Button>
  </form>
 </body>
</HTML>
using System;
namespace chuandi
{
 public class WebForm2 : System.Web.UI.Page
 {
  protected System.Web.UI.WebControls.Button Button1;
  protected System.Web.UI.WebControls.Label Label1;
  public chuandi.WebForm1 wf1;
  private void Page_Load(object sender, System.EventArgs e)
  {
   if(!IsPostBack)
   {
    wf1=(chuandi.WebForm1)Context.Handler;
    Label1.Text="上頁傳來的是:"+wf1.Text1;
   }
  }
  override protected void OnInit(EventArgs e)
  {
   InitializeComponent();
   base.OnInit(e);
  }
  private void InitializeComponent()
  {   
   this.Button1.Click += new System.EventHandler(this.Button1_Click);
   this.Load += new System.EventHandler(this.Page_Load);
  }
  private void Button1_Click(object sender, System.EventArgs e)
  {
   Server.Transfer("WebForm1.ASPx");
  }
 }

AspNet技術2個頁面間不通過Session與url的傳值方式,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: av天堂影音先锋在线 | 538prom国产在线视频一区 | 亚洲AV综合色一区二区三区 | 国产人妻精品无码AV在线五十路 | 51精品国产AV无码久久久 | 亚洲欧美自拍明星换脸 | 欧美xxxxxbb| 色欲人妻无码AV专区 | 日韩精品欧美在线视频在线 | 影888午夜理论不卡 樱桃熟了A级毛片 | fyeex性欧美人与曾 | 蜜芽一区二区国产精品 | 国产精品一区二区资源 | SM调教贱屁股眼哭叫求饶H | 亚洲国产精品VA在线看黑人 | 高清bblxx手机在线观看 | 40岁东北老阿姨无码 | 国产成人精品男人免费 | 国产色欲一区二区精品久久呦 | 国际老妇高清在线观看 | 最近中文字幕2019免费版日本 | 一边喂奶一边做边爱 | 男人把女人桶到爽免费看视频 | 女人18毛片 | 欧美精品专区免费观看 | avtt天堂网Av无码 | 丝瓜涩涩屋黄瓜香蕉丝瓜 | 精品亚洲国产熟女福利自在线 | 国产传媒18精品A片在线观看 | 国产成人精品免费视频下载 | 国产午夜精AV在线麻豆 | 人妻少妇69式99偷拍 | 亚洲伊人久久精品 | 13小箩利洗澡无码视频APP | 国产人妻人伦精品无码.麻豆 | 亚洲欧美日韩在线码不卡 | 伦理片a在线线2 | 办公室的秘密2中文字幕 | 欧美精品专区免费观看 | 免费人成在线观看网站视频 | 拔擦拔擦8X永久华人免费播放器 |