读书人

为什么报错说:不包含“loadPageData”

发布时间: 2012-03-20 14:01:11 作者: rapoo

为什么报错说:不包含“loadPageData”的定义?
<iframe id="ifr1" runat="server" src="ReportPage.aspx" name="iframepage" frameborder="0" scrolling="no" onload="loadPageData()" width="100%"></iframe>



<script type="text/javascript">
function loadPageData() {
var ifm = document.getElementById("ifr1");
var subWeb = document.frames ? document.frames["ifr1"].document : ifm.contentDocument;
if (ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}
</script>

[解决办法]
你这段脚本在哪啊?是在ReportPage.aspx这个页面中还是框架页的宿主页面上?需要放在框架页的宿主页面上才行。

=============================================
ASP.NET分页最终解决之道:http://www.webdiyer.com

读书人网 >asp.net

热点推荐