1. Use of traditional Response.Redirect
For example
String url = "/account/create";
Response.Redirect (URL);
1.server.transfer Method:
Server.Transfer ("m2.aspx");//page steering (performed on server). The server stops parsing this page, saves the data before turning it, and then turns the page to m2.aspx and returns the M2.aspx page results to the browser.
2.server.execute Method:
Server.Execute ("m2.aspx"); After the server saves this page to the previous data, it turns the page to m2.aspx execution, and then returns to this page to continue execution. Merge the three results back to the browser.
The above is the server-side page steering so the browser does not appear the page change record (the displayed address will not change). Therefore, if the user refreshes this page, there may be some other unexpected situation. This type of page turns and can accomplish some other functions, such as accessing the server-side controls on the previous page.
3.response.redirect:
When the browser requests an ASPX page, it encounters the redirect (URL) method, which is equivalent to telling the browser that you need to access a page before the browser sends a request to the server to that page. Relocation is performed through the browser, which generates additional round trips between the server and the browser. In a situation where the network is not in good condition, two requests can greatly reduce the response speed of the application, and even occupy the extra bandwidth.
Summary, in the case of better network status, Redirect (URL) method is the most efficient!! Server.Transfer method and Server.Execute method are the most flexible!! The Server.Execute method consumes the most resources.
2. Use MVC's new Redirecttoaction ("Action name", "Controller name");
Return redirecttoaction ("Index", "Home");//Jump to homepage.
The first parameter is the name of the action, and the second argument is the name of the Director Controller, and the method returns a ActionResult. That is, return to the view.
ASP. NET MVC && ASP page jump