I. Currently, there are several methods for passing values on pages in ASP. NET:
1. Form submission,
<Form action = "target. aspx" method = "Post" name = "form1">
<Input name = "param1" value = "1111"/>
<Input name = "param2" value = "2222"/>
</Form>
....
Form1.submit ();
....
This method is implemented in ASP. Net is invalid because ASP. . Net forms are always submitted to their own pages. If you want to submit other pages, special processing is required.
2. Link Transfer
Receiving page: String STR = request ["param1"]
3. Session sharing
Sending page: Session ("param1") = "1111 ";
String STR = SESSION ("param1"). tostring ();
4. Application Sharing
Sending page: Application ("param1") = "1111 ";
By page: String STR = Application ("param1"). tostring ();
This method is not often used. Because the application is shared within an application domain, all users can change and set its value. Therefore, only the counters and other places that require global variables are used.
5. Cookie
6. response. Redirect () method
Response. Redirect ("target. aspx? Param1 = 1111? M2 = 2222 ")
Receiving page: String STR = request ["param1"]
7. server. Transfer () mode.
Server. Transfer ("target. aspx? Param1 = 1111? M2 = 2222 ")
Receiving page: String STR = request ["param1"]
If you need to transmit a large number of parameters between two pages, such as data query pages, use the 1-6 method to transfer the value and the inconvenience, the 7th methods have a unique advantage! However, some settings are required when this method is used.
Http://www.cnblogs.com/jetxia/archive/2007/03/22/683805.html