AxWebBrowser.Navigate2 issue

764 Views Asked by At

I am using AxWebBrowser object to render html/flash. I have added this object in a form. I have noticed a strange issue while rendering onto the form using AxWebBrowser.Navigate2. But it is not consistent and occurs intermittently (4/10).

The displayed content sometime comes as total blank i.e. white screen. At times only the edge comes as white and the rest of the rendered content is fine.

I am not able to understand the issue here. I have tried the following - Calling Navigate2 with "about:blank" and then with actual URL - Calling Navigate2 twice. - Using Navigate instead of Naviagte2.

But the issue is still there.

Any help here is appreciated.

Thanks in advance.

2

There are 2 best solutions below

0
On

Dont know if you have solved this, but I had a similar issue, but in my case flash content was constantly not loaded... The reason for that was because I was building my project to run for x64 windows and as there is not 64 bit for the flash player yet, then the content is not loaded.

To solve this, change the platform target in your project properties: Project - [Project Name] Properties - Build - Target Platform: x86

Hope this helps

0
On

This is an old thread but still putting my thoughts for others...

In my code I called "Navigate2(ref urlStr, ref emptyStr, ....)" first with urlStr value as "about:blank" and then called it again with urlStr value as "stackoverflow.com". This worked for me. Other than that the only thing I can think of is the way you add WebBrowser control on your windows form. May be try this.

webBrowserInstance.BeginInit();
webBrowserInstance.Parent = mainForm;
webBrowserInstance.EndInit();

Also make sure you add reference to AxSHDocVw.dll, SHDocVw.dll assemblies that were built using .Net framework same as your application.

I used this browser in one of my webapp to capture screenshot of the current page. I too had problems with rendering Flash. I had to set "Allow 32 Bit application" property to True on the app pool that hosted this webapp. So may be for windows app changing that Target Platform might help. I guess flash drivers don't support 64 bit machines yet but I don't have any evidence to prove that.