I have a dynamically generated HTML code rendered on a browser instance
created though code (AxSHDocVw.AxWebBrowser instance) . I have used a
javascript to generate a print preview.
function printPreview () {
var WebBrowser = '';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(7, 1);
the following error:
"An Activex Control on this page is not safe."
Your current security settings prohibit running unsafe controls on this
page.
I do not have any option to modify the security settings as the browser
instance what I have is instantiated through code
(AxSHDocVw.AxWebBrowser object)
Also, when I use the same HTML code and save it on the disk and then
open the file, the Javascript executes without any problems.
Can anyone provide a solution as to how I can prevent this error and
execute the script successfully ?
Replies
Know the answer? Post it — somebody with the same question will find it here.