How can I jump to an ASP. NET page ?, What are the differences between the three methods? Let's start:
ASP. NET page Jump 1, response. the redirect method does not jump quickly because it takes two rounds (two postback), but it can jump to any page, there is no website page restriction (that is, you can jump from Yahoo to Sina), and you cannot skip logon protection. However, slow speed is the biggest defect! Redirect jump mechanism: First, send an http request to the client. The notification needs to jump to a new page, and then the client sends a jump request to the server. It should be noted that after the jump, all data information stored in the internal space will be lost, so session is required.
ASP. NET page Jump 2, server. transfer is fast, only one postback, .... It must be on the same site because it is a server method. In addition, he can skip logon protection. You can try to write a small program: design a jump from page 1 to page 2, but to enter page 2, You need to log on and perform form authentication. However, if the jump statement uses transfer, the logon page will not pop up. The redirection request of this method occurs on the server, so the url address of the browser still retains the address of the original page!
Asp.net 3eclipsever.exe cute this method is mainly used in the page design, and he must jump to the page under the same site. This method needs to be used to insert the output results of a page to another aspx page. Most of them are in the table, where a page is nested to another page.
Summary of ASP. NET page Jump:
When you need to redirect a user to a page on another server, use redirect
When you need to redirect a user to a non-aspx page, such as html, use redirect
When the query string needs to be retained to the server as part of the url, because the other two methods cannot achieve two postback operations, the data is first brought back to the server, and the redirect
Switch between aspx pages (logon not involved), use transfer
Execute is used to insert the output result of the aspx page to another aspx page.
Of course, I forgot another hyperlink! Of course, you don't need to talk too much about this. He uses hyperlinks when a user needs to decide when to jump to a page.
By the way, how to use the redirect method to use Chinese Characters in query strings is often garbled because URLs do not support Chinese characters. In this case, the conversion is required:
The following is a reference clip:
- String message = server. urlencode ("Welcome to the racing column");
First convert and then use the query string
The following is a reference clip:
- response.redirect("webform2.aspx?msg="+message);
The method of ASP. NET page Jump is introduced here. I hope this will help you understand ASP. NET page Jump.
- Analysis of ASP. net html Control Learning
- Procedure for ASP. NET to obtain MAC addresses and IP addresses
- Analysis on Static Page implementation using ASP. NET
- Analysis of ASP. NET connection string Traversal
- Analysis on the types and features of ASP. NET Cache