【发布时间】:2012-02-04 02:16:38
【问题描述】:
我正在尝试在我的页面中嵌入谷歌文档查看器。 下面是 test.aspx 代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Web_Application.test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<iframe id="documentLoader" src="https://docs.google.com/viewer?embedded=true&url=http://view.samurajdata.se/license.pdf"
style="width:100%; height:800px;">
</iframe>
</body>
</html>
这是我的 test.aspx.cs
namespace Web_Application
{
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
我收到诸如
之类的错误'Line: 409
Error: Unable to get value of the property 'k': object is null or undefined'
或
'Line: 458
Error: Unable to get value of the property 'a': object is null or undefined'
来自 google doc viewer 在线 javascript 资源...
所以我将脚本嵌入到标题中并且它起作用了。但问题是,如果我在用户控件或从母版页继承的页面中执行此操作,我会再次遇到这些错误。
我该如何解决这个问题?
谢谢。
【问题讨论】:
-
如果您自己找到了解决此问题的方法,请使用您自己的答案更新此问题并将其标记为已接受。这也将提高您的低接受率。
标签: javascript asp.net iframe master-pages google-docs