|
1. <body>
<form id = "form1" runat = "server">
<div>
<asp: Label ID = "Label1" runat = "server" Text = "Your name is:"> </ asp: Label>
<asp: TextBox ID = "name" runat = "server"> </ asp: TextBox> <br />
<asp: Label ID = "Label2" runat = "server" Text = "Your age is:"> </ asp: Label>
<asp: TextBox ID = "age" runat = "server"> </ asp: TextBox> <br />
<asp: Button ID = "Button1" runat = "server" Text = "Submit" OnClick = "Button1_Click" />
<br />
<br />
<br />
</ div>
</ form>
</ body>
protected void Button1_Click (object sender, EventArgs e)
{
// Method for passing multiple data from one web page to another web page
//Response.Redirect("get.aspx?id= "+ name.Text +"&age = "+ age.Text);
Response.Redirect ("get.aspx");
}
2,
protected void Page_Load (object sender, EventArgs e)
{
string recive_id, recive_age;
recive_id = Request.Form ["id"];
recive_age = Request.Form ["age"];
Response.Write ("My name =" + recive_id + "<br/>" + "My age =" + recive_age + "<br/>");
// 3\
Response.Write ("You are using" + Request.RequestType + "Method to pass data");
}
How can I get their value? Please master point me. I have already posted this post before, but I still can't pass it on. Is it because the method I wrote in the Button1_Click event is wrong? Please master |
|