asp.net 5 kinds of Page steering method _ Practical skills

Source: Internet
Author: User
label
1.<a href= "Test.aspx" ></a>
2. This is the most common kind of steering method;
Hyperlink control
1.asp.net server-Side control properties NavigateUrl Specify the URL address to jump to
2.NAVIGATEURL is a code modification that can be used on the server side, which is different from <a>
3. Because hyperlink itself does not have events, it is set to NavigateUrl in other events on the server side
4. code example
<asp:hyperlink id= "HyperLink" runat= "Server" navigatoeurl= "Test.aspx" >ok</Asp:HyperLink>
Response.Redirect () method
1. Process: Sends an HTTP response to the client, notifies the client to jump to a new page, and then sends the client again to send a jump request to the server side.
2. After the page jumps all the information saved by the internal control is lost, when a jumps to the B,b page will not be able to access the data information submitted by page A.
3. Use this method to change the URL information of the browser's address bar after using this method
4. You can use the session cookie application and other objects to transfer data between pages
5. Redirect operations occur on the client, involving two communications with the Web server: one for the original page and one for the new page redirection request
Server.Transfer () method
1. To achieve the page jump at the same time the control of the page to transfer
2. Page jump process, such as request session saved information unchanged, after the jump can use the previous page submitted data
3. After the Jump browser address bar URL does not change
4. The redirection request of this method is done on the server side, the browser does not know that the page has already occurred a jump
Server.Execute () method
1. This method allows the current page to execute another page on the same Web server
2. After the completion of the page, return to the original page issued Server.Execute () location.
3. This approach is similar to a function call to a page the requested page can use the original page's form data and query string collection
4. The enableViewStateMac property of the page directive for the called pages is set to False
Topic Related:
1. It is best to use the Response.Redirect method to ensure the legitimacy of Html output, because the page returned to the client by the Server.Execute or Server.Transfer method contains more than one 2. Because Server.Transfer performs redirection on the server side, it avoids unnecessary network traffic, resulting in better performance and browsing effects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.