天天躁日日躁狠狠躁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的傳值方式,轉載需保留來源!

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

主站蜘蛛池模板: 国产高清美女一级毛片久久 | 少妇被阴内射XXXB少妇BB | 精品一区二区三区高清免费观看 | 日本妈妈在线观看中文字幕 | 免费精品美女久久久久久久久久 | 亚洲一区二区三区91 | 久久国产乱子伦免费精品 | 色狠狠一区二区 | 日韩午夜中文字幕电影 | lesbabes性欧美 | 最近的2019中文字幕国语完整版 | 国产麻豆AV伦 | asian极品呦女xx农村 | 免费观看久久 | 一级做a爰片久久毛片免费 一级做a爰片久久毛片潮喷动漫 | 男女做爽爽爽视频免费软件 | 三级视频网站 | 亚洲电影成人 成人影院 | 99久久国产宗和精品1上映 | 亚洲人美女肛交真人全程 | 国产精品久久自在自2021 | 亚洲日本欧美国产在线视 | 99久久蜜臀AV免费看蛮 | H揉捏娇喘乳叫床NP调教视频 | 暖暖日本手机免费完整版在线观看 | 麻豆久久国产亚洲精品超碰热 | 日本一卡精品视频免费 | 超碰公开在线caopon | 一本道色综合手机久久 | 国产婷婷综合在线视频中文 | 午夜毛片在线观看 | 亚洲精品美女久久久久99 | 先锋影音av最新资源 | 国产在线观看网址你懂得 | youjizz护士 | 最近中文字幕2018MV高清在线 | SM脚奴调教丨踩踏贱奴 | 阿离被扒开双腿疯狂输出 | 国产在线一区二区三区四区 | 天堂无码人妻精品AV一区 | 无码精品AV久久久奶水 |