Write ASP. net program, we often encounter page Jump problems, we often use Response. redirect for ASP. NET Framework page Jump, if the customer wants to use the prompt when the jump, this is not a good thing, such:
- 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:
Another implementation of ASP. NET Framework page Jump
- Response. Write ("< Script Language=Javascript>Alert ('Congratulations, registration successful! ')</Script>");
- Response. Write ("< Script Language=Javascript>Window. 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>Window. parent. frameLeft. location. href='Main.html'</Script>");
In this way, the ASP. NET Framework page Jump interruption is solved.
- Web Resources Management model provided by ASP. NET 2.0
- ASP. NET Server custom control security guidelines
- Analysis of ASP. NET programming standards and Their encoding specifications
- Introduction to ASP. NET sessions
- ASP. NET programming tool ASP. NET Web Matrix