Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > WebBrowser control not responding because of Javascript

Reply
Thread Tools

WebBrowser control not responding because of Javascript

 
 
Stephane
Guest
Posts: n/a
 
      11-27-2008
Hi,

I'm trying to make screenshots of web pages from an ASP.net 2.0 page. One
trick I found is to use the Webbrowser control which works pretty fine.
however, I stumbled upon that website (http://taxi535.blogspot.com/) where
there is a annoying javascript when we quit the page. This Javascript makes
my asp.net page using the WebBrowser control to loop infinitely. How can I
get rid of that?

// Load the webpage into a WebBrowser control
WebBrowser wb = new WebBrowser();
wb.ScrollBarsEnabled = false;
wb.ScriptErrorsSuppressed = true;
wb.Navigate("http://taxi535.blogspot.com/");

while (wb.ReadyState != WebBrowserReadyState.Complete)
{
System.Windows.Forms.Application.DoEvents();
}

// Set the size of the WebBrowser control
wb.Width = 1024;
wb.Height = 768;

// Get a Bitmap representation of the webpage as it's rendered in the
WebBrowser control
Bitmap bitmap = new Bitmap(wb.Width, wb.Height);
wb.DrawToBitmap(bitmap, new Rectangle(0, 0, wb.Width, wb.Height));
wb.Dispose();

I found that I could use the Silent property, but it's not working with
ASP.NET 2.0 and I get this error :
System.Windows.Forms.WebBrowser does not contain a definition for Silent

I tried to limit the while, but it's not working either.

So I don't know what else to do to disable javascript. I'm thinking of
switching to another method to get that screenshot. Any trick or idea would
be appreciated.

thanks!

Stephane

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling JavaScript inside the webbrowser module Anders Gunnarsson Python 1 10-31-2011 12:53 AM
How do I debug JavaScript in a WebBrowser control? John Brock ASP .Net 5 09-15-2009 08:42 PM
WebBrowser control not responding because of Javascript Stephane ASP .Net Web Controls 0 11-27-2008 01:08 PM
Screen capture control using WebBrowser control and GDI+ in a web app JP2006 ASP .Net 1 01-07-2007 07:51 PM
Responding to Button control events when Button is added to a Table Control Jim Gilligan ASP .Net Web Controls 0 09-01-2005 06:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57