Anjani Kumar Agrawal Anjani Kumar Agrawal - 1 year ago 93
C# Question

Disable on Parent Span Not Disabling Child Checkbox in Chrome

So I have C# code that disables a checkbox:


This adds a new Span parent with disabled attribute to the chkbox.

<span disabled="disabled">
<input id="ctl00_DataContentHolder_chkbox" type="checkbox" name="ctl00$DataContentHolder$chkbox" checked="checked">

The checkbox is now disabled in IE but not in Chrome. How do I disable it in Chrome by modifying my C# code?

Answer Source

Try this:

   chkbox.Enabled = false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download