正解如下:
A向B页面传值
A页面源 视图代码
选择button的postBackUrl 的属性为B页面
<asp:TextBox ID="TextBox1" runat="server" Width="366px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="~/b.aspx" /></div>
B页面
.cs文件取值代码
protected void Page_Load(object sender, EventArgs e)
{
if (this.PreviousPage != null)
{
Response.Write(((TextBox)(this.PreviousPage.FindControl("TextBox1"))).Text);
}
else
{
Response.Write("没感觉");
}
}