Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9115937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:33:08+00:00 2026-06-17T04:33:08+00:00

We have a winforms application with an embedded IE control. In this IE control,

  • 0

We have a winforms application with an embedded IE control.

In this IE control, we run a web application (I control the web application but not the winforms application).

In the web application, I run some javascript to open a sub-window and populate it with HTML:

    var features = "menubar=no,location=no,resizable,scrollbars,status=no,width=800,height=600,top=10,left=10";
    newTarget = "reportWin" + String ( Math.random () * 1000000000000 ).replace( /\./g ,"" );
    reportWindow = window.open('', newTarget, features); 
    var d = reportWindow.document; // <-- Exception is thrown here
    d.open();
    d.write('<head>\r\n<title>\r\n...\r\n</title>\r\n</head>');
    d.write('<body style="height: 90%;">\r\n<table style="height: 100%; width: 100%;" border="0">\r\n<tr>\r\n<td align="center" valign="middle" style="text-align:center;">\r\n');
    d.write(...);
    d.close();

When we run the web application within this WinForms app (but not by itself nor in another WinForms app) we get a Javascript error at the indicated line:

Line 0: Access denied

Any ideas on why this could be happening or on how I could avoid it? Note that the window is not opening a URL; it’s just an empty window.

From the same application, opening a window with a specified URL in the same domain does work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:33:10+00:00Added an answer on June 17, 2026 at 4:33 am

    Based on:

    1. IE 6/7 Access Denied trying to access a popup window.document
    2. http://thecodecave.com/2006/07/20/how-to-get-around-access-is-denied-in-a-windowopen-javascript-call/

    The problem you are having is that the Url being opened needs to be on the same domain as the page that is opening it. Presumably a blank Url will not share the domain of its creator. I wrote a couple of quick test web pages and found

    1. Calling var reportWindow = window.open('', newTarget, features); resulted in the access denied error.
    2. Same thing with var reportWindow = window.open('http://google.com', newTarget, features);
    3. But opening up another page in the site which does the rendering does work var reportWindow = window.open('WebForm2.aspx', newTarget, features);

    This last one popped up a window pointing to WebForm2.aspx which executed this code:

    window.document.open();
    window.document.write('<head>\r\n<title>\r\n...\r\n</title>\r\n</head>');
    window.document.write('test<body style="height: 90%;">\r\n<table style="height: 100%; width: 100%;" border="0">\r\n<tr>\r\n<td align="center" valign="middle" style="text-align:center;">\r\n');
    window.document.close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WinForms Application that I want to run at Mono at some
I have a WinForms application with a bunch of third party references. This makes
I have a pretty simple winforms application. It contains a rich edit box, embedded
I have a WinForms application that was written in C# .NET 3.5. This application
I have a WinForms application, running on .net 3.5. This Application generates HTML on
I have a winforms application in which some of the data is stored in
I have a WinForms application that uses the ReportViewer control. I have a report
I have a WinForms application with a user control in which I change the
I have a Winforms application that does some hefty database work. It does a
We have a WinForms application that we are progressively converting to WPF. At this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.