Here is how you could simulate the click action on your login button:
webView.InvokeScript("eval", new[] { "document.getElementById(\"login\").click();" });
Here is the code if you want to get notified when the button is clicked:
Register for LoadComplete and use the folowing code to add a click handler:
private void WebView_OnLoadCompleted(object sender, NavigationEventArgs e)
{
webView.InvokeScript("eval", new[]
{
"var loginButon=document.getElementById(\"login\");" +
"if (loginButon.addEventListener) {" +
"loginButon.addEventListener(\"click\", clickFunction, false);" +
"} else {" +
"loginButon.attachEvent('onclick', clickFunction);" +
"} " +
"function clickFunction(){" +
" window.external.notify('loginClick');"+
"}"
});
}
In the page constructor enable web view notification, you should specify the uri of the page you are working on or you can enable all uri:
webView.AllowedScriptNotifyUris = WebView.AnyScriptNotifyUri;
Finally register for the ScriptNotify event and use the following handler :
private void WebView_OnScriptNotify(object sender, NotifyEventArgs e)
{
if (e.Value == "loginClick")
{
//Login button have been clicked
}
}