This article mainly introduced the ASP.net page and the page to pass the parameter value method, explained the post pass value and get passes the value the use method, needs the friend to be possible to refer to under
First, the use of Post value transfer ASP file send.aspx code is as follows: <form id= "Form1" runat= "Server" action= "receive.aspx" method= post> <div> <asp:button id= "Button1" runat= "Server" onclick= "button 1_click "text=" button "/> <asp:textbox id=" username "runat=" server "></asp:TextBox> </div> </ Form> Accept ASP file receive.aspx code as follows: string username = ruquest.form["Receive"]; One, get method transfer value QueryString also called query string, this method will be passed the data appended to the Web page address (URL) to pass. such as page a.aspx jump to the page b.aspx, you can use Request.redirect ("b.aspx? parameter name = parameter value") method, you can also use hyperlinks:, page jump, in the target page to be available ruquest["parameter name" to receive parameters. The advantage of using the Querysting method is that it is simple to implement and does not use server resources; The disadvantage is that the value passed is displayed in the browser's address bar, there is a risk of tampering, cannot pass the object, only the query string is feasible when requesting the page through the URL The following code snippet demonstrates how to implement this method: Source page code: Code as follows: private void Button1_Click (object sender, System.EventArgs e) {s Tring URL; Url= "Anotherwebform.aspx?name=" + TextBox1.Text + "&email=" + TextBox2.Text; Response.Redirect (URL); } &NBsp Target page code: Code is as follows: private void Page_Load (object sender, System.EventArgs e) {label1.text=request.querystring[ "Name"]; label2.text=request.querystring["email"]; }