Jump to the frame page

Source: Internet
Author: User

In Asp. when using the framework page, the Framework page is often redirected in the internal pages of the framework, but we often encounter the following situation: that is, we need to jump to not only some framework pages, instead, you can jump to the entire homepage. For example, you need to jump to the login page when operating on the left-side page of the framework.

In this case, the redirection is actually the same as the redirection of the main framework in HTML. When HTML is used in the early stage, Javascript is used. In Asp.net, the background code can be:

Response. Write ("<script> parent. location = 'login. apsx '; </script> ");
Response. Write ("<script> top. location = 'login. apsx '; </script> ");
Response. Write ("<script> parent.doc ument. location. href = 'login. apsx '; </script> ");

When we need to transfer not only the framework page, but also parameters, we can use QueryString to add "? XX = 'xxxxx'. You can also use Session.

After the problem is solved, let's extend the following:

What if we want to jump to not the main framework page, but the right side or even any page in the framework?

The answer is actually quite simple. Let's take a closer look at the three jump statements listed above, which are used to obtain the framework object of the parent layer in ipvnet, and then perform the jump, in fact, we only need to use Javascript that we are familiar with to get the corresponding framework object to jump to. As for passing parameters, it is exactly the same as above!
Let's take a look at the following example:

Response. Write "<script language = 'javascript '> window. location = 'left. aspx'; parent. rightframeName. location = 'Right. aspx '</script> ");

Is the redirection implemented? Yes, congratulations, but is that OK? No...
We found that the framework on the left was indeed redirected, but the framework on the right was refreshed immediately, some changes made on the right side of the page have also been reset. This is not the result we want. What should we do? Let's look at the following:
We all know that this problem does not exist in the HTML era. Why? Hey, because it is an HTML control that uses the JavaScript client code, so it will not be sent back to the server, can we also use the HTML control and then implement it in its onclick time? Of course you can. Don't tell me that you are using a server-side control. You need to implement it in the background code, in the LOAD time, it is okay to add an onclick event to the AddAttributes method.
I made a profit on the Internet and found a method proposed by a cool man. After reading it, I had to mention the target in HTML. What is the specific content? Set the whiteness on your own ~
Here I copied the Niu Ren solution:

Assume that the Left frame is frmLeft, And the right frame is frmRight.

<Frame name = "frmLeft" src = "left. aspx">
<Frame name = "frmRight" src = "right. aspx">

There are several types of numerical transfer between the left and right frames.

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.