If you want to toggle read-only attribute in a textbox you cant do it as follows.
//This will make the textbox read only .
textBoz.Attributes["readonly"] = "true";
//This will not remove read only from the text box.
textBoz.Attributes["readonly"] = "false";
Solution:-
//This will make the textbox read only .
textBoz.Attributes["readonly"] = "true";
//This will remove read only from the text box.
txtAbn.Attributes.Remove("readOnly");
//This will make the textbox read only .
textBoz.Attributes["readonly"] = "true";
//This will not remove read only from the text box.
textBoz.Attributes["readonly"] = "false";
Solution:-
//This will make the textbox read only .
textBoz.Attributes["readonly"] = "true";
//This will remove read only from the text box.
txtAbn.Attributes.Remove("readOnly");
Comments