views:

55

answers:

1

I'm trying to solve a problem where I'm intercepting a request in Navigating and want to inject an additional request parameter into that request before passing it off.

Here are the steps:

First I make a request via WebBrowser.Navigate. I have an event handler to capture the Navigating event.

The request hits the Navigating event (before the actual request is made). I, at this point, want to either cancel the request and issue a new request with the added parameters, or somehow alter the current request to have the correct parameter.

Unfortunately I cannot simply call the Cancel event, and re-issue a Navigate call because of one problem. This request is from an iframe, so its one level deep, and the navigate call would clobber the end result of the document contents (as it would show only the iframe contents and not its parent's).

Any suggestions?

A: 

It seems impossible to inject a new parameter into a request on low level.

A recommended way is to alter html source of a page sends a request. For instance, add a hidden input field inside a form just after page is loaded. IMHO.

Dmitry Karpezo