Comparison of four page Jump technologies in Asp.net web pages

Source: Internet
Author: User

There are four page navigation methods in Asp.net. How do I select one for your page?

· If you want users to decide when to convert a page and which page to go to, hyperlink is the most suitable.

· If you want to useProgramTo control the conversion target, but the conversion time is determined by the user. Use the web server's hyperlink control to dynamically set its navigateurl attribute.

· If you want to connect a user to resources on another server, use response. Redirect.

· Use response. Redirect to connect users to non-aspx resources, such as HTML pages.

· If you want to retain the query string as part of the URL, use response. Redirect.

· If you want to transfer the execution process to another ASPX page of the same web server, you should use server. transfer instead of response. redirect, because server. transfer can avoid unnecessary network communication to achieve better performance and browsing performance.

· If you want to capture the output result of An ASPX page and insert the result to a specific location of another ASPX page, use server. Execute.

· To ensure that the HTML output is valid, use response. Redirect instead of server. Transfer or server. Execute.

 

About server. Execute,

This page navigation method is similar to calling the callback function for the ASPX page. The called page can access the form data and query string set of the calling page, therefore, set the enableviewstatemac attribute of the called page command to false.

By default, the output of the called page is appended to the current response stream. However, server. the execute method has an overloaded method that allows a textwriter object (or its sub-object, such as the stringwriter object) to obtain the output of the called page, rather than directly appending it to the output stream, on the original page, you can easily adjust the location of the output result of the called page.

Related Article

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.