I have a grid and want to add or remove the disable attribute based on a condition from the code behind.
Below is the jQuery code:
$("#myGrid tbody :input").attr("disabled", "disabled");
I want to do the exact same thing from code behind. I have mentioned "runat=server" on #myGrid element. In the code behind, I tried something like below:
if (condition-here)
{
myGrid.Attributes.Remove("disabled");
}
else
{
myGrid.Attributes.Add("disabled","disabled");
}