页面一
public
string
name
{
get
{
return this .TextBox1.Text;
}
}
public string EMail
{
get
{
return this .TextBox2.Text;
}
}
protected void Button1_Click( object sender, EventArgs e)
{
Context.Items.Add( " name " , name);
Context.Items.Add( " EMail " , EMail);
Server.Transfer( " WebForm2.aspx " );
}
{
get
{
return this .TextBox1.Text;
}
}
public string EMail
{
get
{
return this .TextBox2.Text;
}
}
protected void Button1_Click( object sender, EventArgs e)
{
Context.Items.Add( " name " , name);
Context.Items.Add( " EMail " , EMail);
Server.Transfer( " WebForm2.aspx " );
}
跳转后的页面
Response.Write(Context.Items[
"
name
"
].ToString()
+
Context.Items[
"
EMail
"
].ToString());
2:cs端返回上一页
获取页面地址存入ViewState
步骤一: ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
步骤二: Response.Redirect((String)ViewState["UrlReferrer"]);