We help IT Professionals succeed at work.

IE Web Browser control ActiveX control event trapping

raheelasadkhan
on
Medium Priority
346 Views
Last Modified: 2010-05-18
Hello,

I am writing an application (in C# using VS 2003) that will disaply OFFLINE HTML content in a Web Browser control.

The diaplayed HTML page will exist on the local hard drive. A portion of the page will pull web content while the rest will be an HTML form like the following:

<FORM ID="formSuggestion">
   How does this text apply to you?
   <BR />
   <INPUT ID="txtApply" TYPE="text" />
   <BR />
   <INPUT ID="btnSubmit" TYPE="submit" VALUE="Submit" />
      OR MAYBE
   <INPUT ID="btnSubmit" TYPE="button" VALUE="Submit" ONCLICK="javascript:SubmitClient();" />
</FORM>

When the user clicks the submit button, instead of any HTML action, I want my application to be able to extract the text from the text box control.

I will be using the Microsoft.mshtml library to gaining access to the underlying DOM is not a problem. However, I am not sure on how to access the relevant elements at the appropriate time when the user clicks Submit.

Any ideas?

Thanks,

Khan.
Comment
Watch Question

Commented:
you can hook BeforeNavigate event of browser control. when you click submit the page'll start navigating, and you can process it accordingly in BeforeNavigate event handler.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.