asp:TextBox ReadOnly=true or Enabled=false?
What's the difference between the Enabled and the ReadOnly-properties of an asp:TextBox control?
If a control is disabled
it cannot be edited and its content is excluded when the form is submitted.
If a control is readonly
it cannot be edited, but its content (if any) is still included with the submission.
Another behaviour is that readonly = 'true'
controls will fire events like click
, buton Enabled = False
controls will not.
Readonly will not "grayout" the textbox and will still submit the value on a postback.