如何在一个页面中显示另外一个页面:
<body>
<form id="form1" runat="server">
<iframe src="WebForm.aspx" style="width:500px; height:400px"></iframe>
</form>
</body>
----------------------------------------------------------------------------------------------------
如何使用HttpContext传递页间数据:
WebForm1:
protected void Button1_Click(object sender, EventArgs e)
{
string data = "世界你好";
this.Context.Items.Add("DATA",data);
//不能使用this.Response.Redirect("WebForm1.aspx"),地址栏的URL不变
this.Server.Transfer("WebForm1.aspx");
}
<body>
<form id="form1" runat="server">
<iframe src="WebForm.aspx" style="width:500px; height:400px"></iframe>
</form>
</body>
----------------------------------------------------------------------------------------------------
如何使用HttpContext传递页间数据:
WebForm1:
protected void Button1_Click(object sender, EventArgs e)
{
string data = "世界你好";
this.Context.Items.Add("DATA",data);
//不能使用this.Response.Redirect("WebForm1.aspx"),地址栏的URL不变
this.Server.Transfer("WebForm1.aspx");
}
WebForm2:
protected void Page_Load(object sender, EventArgs e)
{
this.Response.Write(this.Context.Items["DATA"].ToString());
}