Although this is a basic thing, it is still very messy. So today I have made a little effort to organize it. What I want to bring to you is the page Jump problem.
The following are four ways to open a new page.
1. Go directly to the new page. The original page is not retained.
Response. Redirect ("Webform6.aspx? Id = 1 ");
2. Go directly to the new page. The original page is not retained.
NServer. Transfer ("Webform6.aspx? Id = 1 ", true );
3. Open the new page and keep the original page, but both pages can be operated.
NResponse. Write ("<script> window. open ('webform6. aspx? Id = 1', '_ blank', ''); </script> ");
4. Open the new page and keep the original page, but only the child page can be operated. The parent page can be operated only when the child page is closed. Next is the issue of passing values between different pages.
1. Server. Transfer can only jump to the page specified by the local virtual directory, while Response. Redirect can jump to the page specified by other virtual directories, which is very flexible;
2. Server. Transfer can easily pass the page parameters to the specified page. Use a status such:
Server. Transfer ("WebForm2.aspx", True ),
The existing request string and all the variables in the Form will be kept and submitted to your target page. The passed value can only be read when the PAGELOAD function comes in for the first time.
For example, WebForm1.aspx has a text box named TextBox1, which is passed to WebForm2.aspx using preserveForm to True,
Send: Server. Transfer ("Webform6.aspx", true );
Receive: TextBox7.Text = Request. Form ["TextBox1"];
3. When Server. Transfer jumps to another page during use, the address displayed by the browser will not change, and sometimes it will lead to misunderstanding. Of course, this effect is also required in some occasions;
4. Server. Transfer can reduce client requests to the Server