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

x
?
Solved

WebBrowser: Intercept Javascript Alert

Posted on 2006-07-11
2
Medium Priority
?
1,948 Views
Last Modified: 2010-05-18
I have a webbrowser control in a vb.Net 2005 application. When I navigate to a site that gives me a javascript alert, I want to intercept it and display it differently in the application. Can anyone tell me how to do this? Thanks.
0
Comment
Question by:rbichon
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
prakash_prk earned 2000 total points
ID: 17081343
thats possible.

You need to implement IDocHostShowUI and capture the Javascript alert and
confirm message boxes in the ShowMessage method

try the link.

http://groups.google.co.in/group/microsoft.public.inetsdk.programming.webbrowser_ctl/browse_frm/thread/c2fa459bc697e864/eaebf644369c2942?lnk=st&q=IDocHostShowUI+%2B+C%23&rnum=2&hl=en#eaebf644369c2942

regards
prakash
0
 
LVL 10

Expert Comment

by:prakash_prk
ID: 17096926
thanks  rbichon
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question