tags:

views:

231

answers:

3

I have a WPF webbrowser control which navigates the user to a registration site. After the user registers, a collection of headers are sent back alongwith the "finished registration" page.
I have tried the Navigated event, and tried accessing WebResponse property in the event arguments but it's always null.
Is there any other way to access the headers sent?

A: 

I dont think you can access headers like that, best thing to do is, either use Hidden Fields of the form or you can pass on your cookie ASP.NET_SessionID from your finished page to your WPF app, and inside WPF app you can make custom request to your url with same ASP.NET_SessionID cookie where you will continue same session and you will be able to query responses you desire throught WebResponse.

Akash Kava
A: 

After quite a lot of reading, I figured out that WPF web browser actually wraps around the WinForm web browser which inturn wraps around a COM dll (which is even used by Internet Explorer).

Now this COM dll provides a lot of interfaces which are not exposed by any of the wrapper controls. So those who need more control need to implement these interfaces.

I found a browser which implements a lot of these interfaces and neatly provides a lot functionality. Used it and it's working fine. http://www.codeproject.com/KB/miscctrl/csEXWB.aspx

It talks about implemnting a PassthroughAPP package to get the response headers.

Trainee4Life
A: 

Sorry I didn't find anywhere to comment your answer

I've the same problem but the codeproject sample is too big for a small problem. Also it's not handy (copy a dll to system and registering some other dlls). Although .NET libraries are almost well designed wrappers over win32 APIs but a good wrapper worth performance downside. Did you find any thin wrapper specific for retrieving response headers ?

Xaqron