0

I'm trying to embed google docs viewer in my page. Here's the test.aspx code:

<%@ 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>

Here's my test.aspx.cs

namespace Web_Application
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

I get errors such as

'Line: 409
Error: Unable to get value of the property 'k': object is null or undefined'

or

'Line: 458
Error: Unable to get value of the property 'a': object is null or undefined'

which are from google doc viewer online javascript resource...

So I embedded the script in the header and it worked. But the problem is, if I do this in a user control or in a page inherited from a master page I get those errors again.

How can I solve this?

Thank you.

Aaron Azhari
  • 987
  • 1
  • 10
  • 24
  • If you found a solution on this problem on your own, please update this question with your own answer and mark it as accepted. This will also improve your low accept rating. – Coral Doe Sep 20 '12 at 13:00

2 Answers2

0

try this iframe script independent of any browser or version this will work ....

<iframe id="documentLoader" src="https://docs.google.com/viewer?url=http://view.samurajdata.se/license.pdf&chrome=true" style="width: 100%; height: 800px;">
</iframe>

mark yes if works !!! :)

Madhu Beela
  • 2,205
  • 16
  • 16
0
<iframe id="documentLoader"
        src="https://docs.google.com/viewer?url=http//view.samurajdata.se/license.pdf&embedded=true"
        style="width:100%; height:800px;">
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
John
  • 235
  • 1
  • 6
  • 17