Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

ASP.NET 'contentWindow.document is null' error

Does anyone know more about this error and maybe how to fix it? It happens when I call button click from javascript: Form1.button1.click();

Thanks
0
gromul
Asked:
gromul
  • 3
  • 2
1 Solution
 
venkateshwarrCommented:
Is the current window open?

do the check
if (contentWindow.document)
{

}
0
 
gromulAuthor Commented:
I tried that but get an error message that the contentWindow is undefined. How do I define it?
0
 
venkateshwarrCommented:
simply go one level up and do the check

if (contentWindow)
{

}

0
 
gromulAuthor Commented:
It says that contentWindow is undefined also. What I don't understand is: what's the relationship between calling the button click and contentWindow?
0
 
gromulAuthor Commented:
Thanks venkateshwarr.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now