在Asp.net中我们除了可以用 cookie session application 在页面间传递数值外还可以在html中 设置PostBackUrl属性 设置把页面提交到那里
1页面中
<div>
<asp:Button ID="Button1" runat="server" Text="提交" PostBackUrl="~/页面间传值1.aspx" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
2页面
protected void Page_Load(object sender, EventArgs e)
{
if (PreviousPage != null)
{
TextBox tb = (TextBox)PreviousPage.FindControl("TextBox1");//获取向当前页面传输控件页的指定控件
Response.Write(tb.Text);
}
}