In Asp.net, use js to find the file path and name of the webpage with the other IFRAME tag in the background.

Source: Internet
Author: User

  In ASP. NET Used in Treeview , Linkbutton When the navigation is generated. For example, you can set their open location to a specified frame, as shown in figure Ifmpage ( This is through Target Set Be sure IFRAME Of Name Value Do not set ID Set ID Will be ineffective ) . When you pass Treeview, linkbutton When you navigate to the specified webpage, you will find that IFRAME Label SRC But not changed to the corresponding webpage Path. Is it depressing. I don't know what's going on IE Medium IFRAME Label SRC Value You have been writing Html The path of the webpage specified during the page. This may be IE One Bug ( Personally, it may also be for security, but you don't want ) .

After careful researchIFRAMEThe Study of attributes and methods found the solution to the problem. However, it is troublesome to look at it directly.CodeRight 

 1   Function login (para ){
2 VaR ifmpage = Para;
3 If (Para. tostring () ! = " [Object] " ){
4 Ifmpage = Document. getelementsbyname ( " Ifmpage " );
5 }
6 If (Ifmpage. SRC = Undefined)
7 Return - 1 ; // The ifmpage is not found.
8   If (Ifmpage. readystate = " Complete " )
9 {
10 Return Ifmpage. contentWindow. Location. href
11 }
12 }

In this case, the test is normal in IE8 Windows 7 flagship system.

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.