Click here to Skip to main content
15,614,147 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I'm trying to login programatically to "" using WebBrwoser control.

The problem is when I click on "Log On", the browser doesn't navigate to the next page in the LogonCompleted event.

HtmlElement userName = wBrowser.Document.GetElementById("username");
userName.SetAttribute("value", SomeUserName);

HtmlElement password = wBrowser.Document.GetElementById("password");
password.SetAttribute("value", SomePassword);

wBrowser.DocumentCompleted -= new WebBrowserDocumentCompletedEventHandler(LogonPageLoaded);
wBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(LogonCompleted);

HtmlElement logonForm = wBrowser.Document.GetElementById("logon-submit");

I think this is because the element "logon-submit" calls a JavaScript function or so.

Please, any help would be appreciated.
Updated 12-Aug-11 4:27am

1 solution

Use Fiddler [^] to figure out what the site is doing. That's what I do in a case like this.
Share this answer
Yas_EG 12-Aug-11 10:05am    
Thanks John.. Please give me more details about how to figure out the problem using fiddler. Thanks
#realJSOP 12-Aug-11 10:36am    
There's plenty of info on google about Fiddler.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900