protected void Button1_Click(object sender, EventArgs e)
{
Request.Redirect("Default2.aspx?username=honge");
}
string username = Request.QueryString["username"];//这样可以得到参数值。
<form id="form1" runat="server" action="receive.aspx" method=post>
<div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:TextBox ID="username" runat="server"></asp:TextBox>
</div>
</form>
string username = Ruquest.Form["receive"];
protected void Button1_Click(object sender, EventArgs e)
{
Session["username"] = "honge";
Request.Redirect("Default2.aspx");
}
string username = Session["username"];//这样可以得到参数值。
protected void Button1_Click(object sender, EventArgs e)
{
Application["username"] = "honge";
Request.Redirect("Default2.aspx");
}
string username = Application["username"];这样可以得到参数值。
public string Name
{
get {
return "honge";
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Server.Transfer("Default2.aspx");
}
send d = Context.Handler as send ;
if (d != null)
{
Response.Write(d.Name);//这样可以得到参数值。
}