This is the code of the website :
function checkSubmit(e) { if(e && e.keyCode == 13) { document.frmLogin.submit(); } } <div class="enterButton" onclick="document.frmLogin.submit()">Sign in</div>This is what I tried in c# :
HtmlElementCollection elc1 = webBrowser1.Document.GetElementsByTagName("div"); foreach (HtmlElement element in elc1) { if (element.GetAttribute("InnerHtml").Equals("<DIV onclick=document.frmLogin.submit() class=enterButton>Sign in</DIV>")) { element.InvokeMember("submit()"); } }The
foreachis working and theifstatement is working when it gets to theInvokeMembernothing happens.
trying to InvokeMember a submit button with c#
943 Views Asked by Nathan At
2
Try the Invoke member method without the brackets.