[ASP. NET] in the pop-up window, jump to the content in the parent window using the hyperconnection

Source: Internet
Author: User

Yesterday I encountered a problem, that is, using window. add a hyperconnection to the open window. When you click this connection, you need to jump the content of the parent window to another page. This problem is finally solved later. Now I want to share it with you.

 

1. To facilitate the use of the entire project, I specially wrote this method into a JS file.

// JScript File
Function pageclass (o ){
For (X in O) This [x] = O [x];
This. Open = function (){

VaR pagebody =$ $ ("pagebody ");
VaR pagetitle =$ $ ("pagetitle ");
This. prevpage = pagebody. page;
// If (pagebody. Page & this. Loc = pagebody. Page. LOC ){
// Return;
//}
If (this. inherit ){

This. Loc = (pagebody & pagebody. Page? (Pagebody. Page. Loc + "^"): "") + this. LOC;
Delete this. inherit;
}
Pagetitle. innertext = This. Loc. Replace (// ^/GI, "-> ");
Window. Open ("about: bland", "pagebody", "", true );
Window. Open (this. url, "pagebody", "", true );
Pagebody. Page = this;
}
}

 

2. Add a client function in the parent window

For example:

Note: You need to first load the created JS file in the parent window. The parameter ID here is the ID of the input data.

Function openrredirect (ID ){
New pageclass ({URL: "test. aspx? Id = "+ id, Loc:" title "}). open ();
}

 

3. At last, you can add <A> hyperconnections In the window. You only need to call this method in the parent window.

<A href = "#" onclick = "javascript: opener. openrredirect. Call (opener, ID);/"> </a>

 

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.