Asp.net jumps out of the iframe structure and redirects to logon. asp. netiframe

Source: Internet
Author: User

Asp.net jumps out of the iframe structure and redirects to logon. asp. netiframe

We often need to process web programming. When the session expires, we need to jump to the login page for users to log on, because we may use the IFrame framework, therefore, our login page needs to be displayed on the entire page, rather than an IFrame. Most netizens use the following code for implementation.

Write the following code in the filter:

 

PrintWriter out = response. getWriter (); out. write ("<script> window. parent. location. href = 'login. jsp '</script> ");

My implementation method is as follows: Jump to an action, let the action decide the page to jump to, and then write the code on the login page

<Script language = "JavaScript"> // determines whether the current window has a top-level window. If yes, the address bar of the current window changes, // This will display the function loadTopWindow () {if (window. top! = Null & window.top.doc ument. URL! = Document. URL) {window. top. location = document. URL ;}</script> 
Reference: https://www.cnblogs.com/jiandankuaile/p/7799856.html

Related Article

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.