0
votes

I am working on Windows form WebBrowser- Control.When I am accessing checkbox GetAttribute() method it gave me access denied error, below is the line of code :

if (Checkbox1 != null)
{            
   if (Checkbox1.GetAttribute("checked") == "True")**//Here Error Comes.**
   { //Do Something 
   }
}

ERROR MESSAGE: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED));

Any Suggestion..

1

1 Answers

0
votes

you can access Checkbox1.GetAttribute by the you of below code:

//get checkbox value
        Convert.ToBoolean(usercontrolbrowser.Document.GetElementById("Checkbox1").GetAttribute("checked"));

i hope it will help you.