TextBox.ReadOnly Property
Assembly: System.Web (in system.web.dll)
[BindableAttribute(true)] [ThemeableAttribute(false)] public: virtual property bool ReadOnly { bool get (); void set (bool value); }
/** @property */ public boolean get_ReadOnly () /** @property */ public void set_ReadOnly (boolean value)
public function get ReadOnly () : boolean public function set ReadOnly (value : boolean)
Property Value
true if the contents of the TextBox control cannot be changed; otherwise, false. The default value is false.Use the ReadOnly property to specify whether the contents of the TextBox control can be changed. Setting this property to true will prevent users from entering a value or changing the existing value. Note that the user of the TextBox control cannot change this property; only the developer can.
Important: |
|---|
| The Text value of a TextBox control with the ReadOnly property set to true is sent to the server when a postback occurs, but the server does no processing for a read-only text box. This prevents a malicious user from changing a Text value that is read-only. The value of the Text property is preserved in the view state between postbacks unless modified by server-side code. |
This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins Overview.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Important: