Write ASP. net program, we often encounter page Jump problems, we often use Response. redirect: if the customer wants to use the prompt during the jump, this will not work, for example:
Response. Write ("<script> alert ('Congratulations, registration successful! '); </Script> ");
Response. Redirect ("main.html ");
At this time, our prompt content will jump without coming out, and there is no difference with Response. Redirect ("main.html.
Then we use the following code to test:
Response. Write ("<script language = javascript> alert ('Congratulations, registration successful! ') </Script> ");
Response. Write ("<script language = javascript> commandid location.href+'main.html '</script> ");
This allows us to jump to the page after the prompt.
The most important thing is that the window. location. href statement can implement a framework page, refresh the page of another framework after executing the server code (Response. Redirect cannot be reached, at least I did not find it ):
For example, the index.htm page has two frameworks: frameLeft and frameRight. On the frameRight page, execute the server code and refresh the page in frameLeft.
Previously, the most common issue was to automatically refresh the login box after registration and change the login box to the logged-on page. You only need to add a section after the successfully registered code, that is, you can refresh the page of another framework. The Code is as follows:
Response. Write ("<script language = javascript> alert ('Congratulations, registration successful! ') </Script> ");
Response. Write ("<script language = javascript> Response parent.frameleft.location.href+'main.html '</script> ");