ASP. NET page Jump Method
Most of the methods for page Jump in asp tutorial. net are added here. If you need them, please refer to them.
<A> tag
1. <a href = "test. aspx"> </a>
2. This is the most common method of steering;
HyperLink Control
1. Asp.net server-side control attribute NavigateUrl specifies the Url address to jump
2. NavigateUrl can be modified on the server using code, which is different from <a>
3. Because HyperLink does not have any events, you must set NavigateUrl in other events on the server.
4. Sample Code
<Asp: HyperLink id = "hyperlink" runat = "server" NavigatoeUrl = "test. aspx"> OK </Asp: HyperLink>
Response. Redirect () method
1. Process: Send an Http Response to the client, notify the client to jump to a new page, and then the client sends a jump request to the server.
2. After the page Jump, all information saved by the internal control is lost. When A jumps to B, B cannot access the data submitted on page.
3. Use this method to redirect and change the Url Information in the browser address bar
4. You can use Session Cookies and other objects to transmit data between pages.
5. The redirection operation occurs on the client and involves two communications with the Web server in total: one is the request to the original page, and the other is the request to redirect the new page.
Server. Transfer () method
1. Implement page Jump and hand over control of the page
2. The stored information such as Request Session remains unchanged during page Jump. After the jump, you can use the data submitted on the previous page.
3. the Url in the browser address bar remains unchanged after the jump
4. The redirection request for this method is performed on the server. The browser does not know that the page has already been redirected once.
Server. Execute () method
1. This method allows the current page to execute another page on the same Web server
2. After the page is executed, return to the location where the original page sends Server. Execute.
3. This method is similar to calling the requested page for the callback function of the page. You can use the form data of the original page and query the string set.
4. Set the EnableViewStateMac attribute of the Page command on the called Page to False.
JavaScript
String str = "<script language = webpage Effect> history. go (-2); </script> ";
Response. Write (str );
Topic related:
1. response is recommended to ensure the validity of HTML output. redirect method; because Server. execute or Server. the Transfer method returns multiple <Html> <body> tags to the client's page, which is not a legal HTML page and may cause errors in non-ie browsers.
2. Because Server. Transfer executes redirection on the Server side, it avoids unnecessary network communication and achieves better performance and browsing performance.