• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

IE Web Browser control ActiveX control event trapping


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();" />

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?


1 Solution
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.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now