六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

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

[摘要]下面是全部代碼,已經編譯通過。Chuandi(傳遞)是名字空間WebForm1:<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" Inherits="chuandi.WebForm1&q...

下面是全部代碼,已經編譯通過。
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");
  }
 }




主站蜘蛛池模板: 亚洲天堂在线观看完整版 | 日本中文视频 | 日韩一级视频免费观看 | 最新69堂国产成人精品视频 | 天天综合亚洲 | 日本 国产 欧美 | 色播影视| 日韩a级 | 色小妹综合 | 青草免费视频 | 伊人福利在线 | 日韩一区二三区无 | 午夜久久精品 | 青娱乐免费视频在线观看 | 午夜影视免费完整高清在线观看网站 | 亚洲人与黑人xxxx | 在线亚洲日产一区二区 | 亚洲一区二区黄色 | 四虎影视成人永久在线播放 | 日产国产欧美韩国在线 | 色综合久久久高清综合久久久 | 亚洲国产成人久久午夜 | 青青青国产精品手机在线观看 | 日本不卡在线视频高清免费 | 日本三级韩国三级欧美三级 | 日韩精品第一区 | 天堂8中文在线最新版在线 天堂8中文在线bt | 日本成片网| 青草视频在线看 | 欧美在线看片a免费观看 | 天天操天天干天天玩 | 人人入人人爱 | 伊人院| 一级一级女人真片 | 午夜影院免费观看 | 四虎影视免费永久在线观看 | 一级免费黄色 | 日韩在线不卡视频 | 亚洲精品中文字幕无乱码 | 亚洲破处视频 | 青青青草免费 |