Latest web development tutorials

ASP.NET TextBox ReadOnly property

TextBox controls TextBox controls

Definition and Usage

ReadOnly attribute is used to set or return Can I change the text in the TextBox control.

If the property is set to TRUE, you can not change the text, otherwise FALSE. The default is FALSE.

grammar

<asp:TextBox ReadOnly="TRUE|FALSE" runat="server"/>


Examples

The following examples the ReadOnly attribute is set to "TRUE":

<form runat="server">
<asp:TextBox id="tb1" runat="server" ReadOnly="TRUE"
Text="This text is read only" />
</form>

The demonstration >>

TextBox controls TextBox controls