'c# webbrowser1 checking a checkbox

I am able to fill a textbox and check a button but cannot check a checkbox ith webbrowser control:

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { Fill text box works;

  webBrowser1.Document.GetElementById("loginForm:loginName").SetAttribute("value", "Geek6710");
  webBrowser1.Document.GetElementById("loginForm:password").SetAttribute("value", "123ydf");

Click on button works webBrowser1.Document.GetElementById("loginForm:fbtnLogin").InvokeMember("click"); Check box below does not work webBrowser1.Document.GetElementById("regmsg:chkRedact").SetAttribute("checked","true");



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source