Several methods of Web page jump

Source: Internet
Author: User

1.response.redirect ("http://www.hao123.com", false);

BOOL value is whether to stop execution of the current page

2.server.transfer ("Default2.aspx?name=zhangsan", true);

By default, the Server.Transfer method does not pass the form data or query string from one page to another, but the form data and query string for the first page can be preserved as long as the second parameter of the method is set to true. At the same time, it should be noted when using Server.Transfer: The target page will use the reply stream created by the original page, which results in the machine validation check (machines authentication Check,mac) of the ASP. ViewState that the new page has been tampered with. Therefore, if you want to preserve the form data and query string collections of the original page, you must set the enableViewStateMac property of the page directive of the target pages to false.

3.response.write ("<script language= ' JavaScript ' >window.open (' aaa.aspx ');</script>");

This form of jump can cause the page's original layout to be confusing

Page.ClientScript.RegisterStartupScript (this. GetType (), "alert", "<script>alert (' Success! '); window.location.href= ' cptableganbu.aspx ';</script> ");

This method can keep the original layout

4.response.write ("<script language= ' javascript ' >window.location= ' default2.aspx ' </script>");

Open a new page, the original window is replaced.

5.response.write ("<script>window.showmodaldialog (' default2.aspx ') </script>");

6.response.write ("<script>window.showmodelessdialog (' default2.aspx ') </script>");

ShowModalDialog: The input focus is always maintained when it is opened. The user cannot switch to the main window unless the dialog box is closed. The effect is similar to alert operation.
showModelessDialog: After being opened, the user can randomly switch the input focus. Has no effect on the main window (at most, it is blocked.)

Several methods of Web page jump

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.