One page value passing method:
The default form generated by webform is runat = Sever. Remember to delete it when you do not use the server control.
The Form Action attribute can be used to submit a form to a specified webpage. It can be submitted in get or post mode. Only the elements in the Form have the name attribute.
You can use request [""] to obtain the content submitted by get, not request. form, but post.
1. Form submission forms are submitted to their own pages by default.
2. Link Transfer
<A href = "target. aspx? Param1 = 1111 & param2 = 2222 "> link transfer </a>
Receiving page: String STR = request ["param1"]
3session sharing, sessionid stored in the browser, and other stored on the server
Sending page: session ["param1"] = "1111 ";
String STR = session ["param1"]. tostring ();
4application sharing
5. Store cookies on the client
6. response. Redirect () method
Response. Redirect ("target. aspx? Param1 = 1111 & param2 = 2222 ")
Receiving page: String STR = request ["param1"]
7 server. Transfer () mode.
This can be said to be the method used by face object development. It uses the server. Transfer Method to direct the process from the current page to another page,
The new page uses the response stream of the previous page, and the requested URL remains unchanged.
Therefore, this method is simple and effective.
Server. Transfer ("target. aspx? Param1 = 1111 & param2 = 2222 ")
Receiving page: String STR = request ["param1"]
8 querystring value passing Method
Differences between cookie and Session:
1. Cookie (name, value, expiration time, path, and domain) data is stored in the client's browser, and session data is stored on the server.
2. Cookies are not very secure. Others can analyze the Cookies stored locally and perform cookie spoofing. For security reasons, session should be used.
3. The session will be stored on the server for a certain period of time. When the number of accesses increases, it will occupy the performance of your server. Cookie should be used in consideration of reducing server performance.
4. data stored in a single cookie cannot exceed 4 kb. Many browsers limit that a site can store up to 20 cookies.
5. personal suggestion: store important information such as login information as Session, and store other information in cookies if necessary.
2. page Jump
Page value transfer and page Jump