First, form submission:
Copy Code code as follows:
<formaction= "target.aspx" method = "POST" name = "Form1" >
<input name = "param1" value = "1"/>
<input name = "param2" value = "2"/>
</form>
....
Form1.submit ();
....
This approach is typically used in HTML pages, not in asp.net, because asp.net forms are always submitted to their own pages.
Two, a label link way
Copy Code code as follows:
<ahref= "target.aspx?param1=1¶m2=2" > Link address transfer </A>
Receive page: string str = request["param1"]
third, session sharing
Copy Code code as follows:
Send page: Session ("param1") = "1";
Press receive page string str =session ("param1"). ToString ();
four, application sharing
Copy Code code as follows:
Send page: Application ("param1") = "1";
by page: string str = Application ("param1"). ToString ();
This method is not commonly used because application is shared across an application domain, and all users can change and set their values, so only use counters and so on where global variables are needed.
Five, Cookies
six, Response.Redirect () way
Copy Code code as follows:
Response.Redirect ("target.aspx?param1=1¶m2=2")
Receive page: Stringstr = request["param1"]
Seven, Server.Transfer () way
Copy Code code as follows:
Server.Transfer ("target.aspx?param1=1¶m2=2")
Receive page: Stringstr = request["param1"]