Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make textbox readonly property false in code behind?

I have one TextBox. I want to make textbox readonly property true or false during an event.

I set the TextBox readonly property as true by the following code:

   txtNoOff.Attributes.Add("readonly", "readonly");

But how to make textbox readonly property false? I have tried like below:

   txtNoOff.Attributes.Add("readonly", "false");

But it does not work. How to achieve this? I need all ur suggestions please.

like image 757
thevan Avatar asked Dec 30 '25 14:12

thevan


1 Answers

Just remove the readonly attribute: txtNoOff.Attributes.Remove("readonly");

like image 142
Yuriy Rozhovetskiy Avatar answered Jan 02 '26 02:01

Yuriy Rozhovetskiy