a.aspx页面代码:
protected void Button5_Click(object sender, EventArgs e) { Server.Transfer("b.aspx"); } public string name { get { return this.TextBox1.Text; } }
b.aspx页面代码:
private void TheFour() { a newWeb=Context.Handler as a;//创建页面a的实例 this.TextBox1.Text = newWeb.name; }
b页面必须在前台加入以下一句:
<%@ PreviousPageType VirtualPath="~/a.aspx" %>