All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
XP上安装SqlServer2000_[SQL Server教程]
数据库中的命名规则_[SQL,Server教程]
SQL,SERVER安全的相关T-SQL代码_[SQL,Server教程]
ASP.NET页面数据导出到Excel或Word_[Asp.Net教程]
在PHP中开发XML应用程序之基础篇_[PHP教程]
SQL,Server常见连接错误_[SQL,Server教程]
C#中水晶报表简介
ASP.NET Remoting体系结构(四)
SQL数据库高级教程:SQL CREATE VIEW 语句_[SQL Server教程]
.Net+MySQL组合开发(二),数据访问篇_[Asp.Net教程]
Reading number is top 10 pictures
陪睡门马睿菈自曝写真 称首拍大尺度照片1
Embarrassing things comic collection2
你白吃了多少药
Ashlynn Brooke a group sexy photo1
Sora aoi mirror memorial classics1
心有鱼而力不足
俄罗斯台球天后惊艳魅惑2
张家界的玻璃桥
漂亮脸蛋魔鬼身材2
开始让人感动,后来......
Download software ranking
Ashlynn Video2
jdk1.6 for windows
Unix video tutorial17
The cock of the Grosvenor LTD handsome
中国结婚习俗实录
White deer villiage
在线棋牌游戏3.05版
金山office2007
VeryCD电驴(EasyMule) V1.1.9 Build09081
matrix2
delv published in(发表于) 2014/1/6 8:47:07 Edit(编辑)
2个页面间不通过Session与url的传值方式_[Asp.Net教程]

2个页面间不通过Session与url的传值方式_[Asp.Net教程]

2个页面间不通过Session与url的传值方式_[Asp.Net教程]

下面是全部代码,已经编译通过。
Chuandi(传递)是名字空间

WebForm1:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" Inherits="chuandi.WebForm1" %>


WebForm1








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" %>


WebForm2



Label




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");
}
}





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.