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

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

主站蜘蛛池模板: 欧美亚洲视频在线二区 | 美女被黑人巨大进入 | 国产精品亚洲第一区二区三区 | 乱亲女H秽乱长久久久 | 伊人久久影院大香线蕉 | 先锋影音av最新资源 | 无码欧美毛片一区二区三在线视频 | 91热久久免费频精品99欧美 | 美女爽到嗷嗷嗷叫 | 亚洲国语在线视频手机在线 | 久久棋牌评测 | 最近中文字幕免费高清MV视频 | 精品午夜寂寞影院在线观看 | 狠狠啪在线香蕉 | 在线免费观看亚洲视频 | 国产电影午夜成年免费视频 | 中文字幕成人在线观看 | 国产精品高清视亚洲一区二区 | 久久亚洲精品成人 | caoporn免费视频在线 | 高潮久久久久久久久不卡 | SM调教贱屁股眼哭叫求饶H | 让人爽到湿的小黄书 | 无人区日本电影在线观看 | 好男人视频免费高清在线观看www | 久久精品国产eeuss | 果冻传媒在线观看完整版免费 | 色噜噜视频 | 绿巨人www | 伊人网中文字幕 | 最新影音先锋av资源台 | 网友自拍区视频精品 | 伊人久久青青草 | 女人一级毛片免费观看 | 亚洲国产果果在线播放在线 | 久久精品99国产精品日本 | 欧美在线看欧美视频免费 | 99视频精品全部免费免费观 | 快插我我好湿啊公交车上做 | 久久99国产综合精品AV蜜桃 | WWW婷婷AV久久久影片 |