日期:2014-05-18  浏览次数:20438 次

为什么报错说:不包含“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