Adaptive Height Processing When IFRAME/frame is embedded into Silverlight

Source: Internet
Author: User

If IFRAME is embedded in a common webpage, Baidu can easily find the highly adaptive IFRAME solution in this scenario.

However, when silvelight is embedded, the parent page of IFRAME is embedded by default.Don't knowThe actual height of the Silverlight content, so the above method does not work.

In fact, you just need to change your mind: Since the parent page does not know the SL height in IFRAME, cannot the SL manually report its height to the parent page?

First look at the final effect:

Note: page1 and page3 are all usercontrol in SL.

CodeSee the followingSource code:

The main steps are as follows:

1. SL actively reports the height of the current SL page through JS interaction with the parent page in page_loaded of each page

2. Use js to dynamically adjust the IFRAME/frame height after the parent page gets the height

Sample source code: http://files.cnblogs.com/yjmyzz/SL_Iframe_Height_Sample.7z

 

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.