request页面
protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect("Request_2.aspx?id="+txtkey.Text); }
<body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtkey" runat="server"></asp:TextBox> <asp:Button ID="btnSearch" runat="server" Text="搜索" οnclick="btnSearch_Click" /> </div> </form> </body>
request_2页面
protected void Page_Load(object sender, EventArgs e) { Response.Write("地址栏传至"+Request.QueryString["id"]); }
protected void btnresult_Click(object sender, EventArgs e) { Response.Redirect("Welcome.aspx?name="+txtName.Text+"&sex="+rblsex.SelectedValue); }