一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

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

下面是全部代碼,已經(jīng)編譯通過。
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技術(shù)2個頁面間不通過Session與url的傳值方式,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 色婷婷综合和线在线 | 成年香蕉大黄美女美女 | 国产91久久久久久久免费 | 日产一一到六区麻豆 | 国产成人精品亚洲77美色 | 中文字幕在线观看国产 | 欧美日韩亚洲国产无线码 | 婷婷伊人五月 | 国内精品中文字幕 | 人人做人人爽人人爱影视 | 亚洲一区精品视频在线 | 亚洲第一精品福利 | 久久精品国产精品青草 | 999热成人精品国产免 | 欧美xxxwww | 黄色视屏免费看 | 伊人久色 | 婷婷四色 | 最新日本免费一区二区三区中文 | 久久97久久97精品免视看清纯 | 日韩精品视频一区二区三区 | 五月婷婷 六月丁香 | 中文字幕在线观看一区二区三区 | www日本黄色| 国产91观看 | 国产人成午夜免视频网站 | 91久久精一区二区三区大全 | 狠狠干综合 | 亚洲国产精品日韩一线满 | 伊人网站在线观看 | 加勒比一本大道在线 | 大象蕉国产情侣 | 亚洲精品国产自在久久老牛 | 亚洲国产系列一区二区三区 | 国产亚洲视频在线观看 | 在线亚洲欧美性天天影院 | 亚洲图片欧美文学小说激情 | 一级毛片国产真人永久在线 | 欧洲美女高清一级毛片 | 精品久久久久久亚洲精品 | 女人洗澡一级特黄毛片 |