从后面的父页面代码访问iFrame中的控件 [英] Accessing the control inside iFrame from parent page code behind

查看:62
本文介绍了从后面的父页面代码访问iFrame中的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设在页面page1.aspx内有一个Label控件.我将pageMain.aspx内的该页面称为iFrame.我需要在背后的代码中访问我的pageMain.aspx内部的Label控件(不在Java脚本中).我该如何实现?

Suppose a Label control is there inside a page page1.aspx. I am refering that page inside pageMain.aspx as an iFrame. I need to access that Label control inside my pageMain.aspx in code behind(not in java script). How can I achieve this?

推荐答案

您不能. IFrame中的页面是客户端加载容器页面之后完全独立的请求.

但是,您可以通过
做类似的事情 1.将子页面的功能重构为用户控件,并显示该页面而不是IFRAME.
2.使用JavaScript修改/访问子内容页面控制树.
You can''t. The page in the IFrame is an entirely seperate request made after the container page has been loaded by the client.

However, you may be able to do something like this by
1. Refactoring the functionality of the child page into a user control and displaying that instead of the IFRAME.
2. Use JavaScript to modify/access the child content pages control tree.


这篇关于从后面的父页面代码访问iFrame中的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆