A disabled TextBox or similar control does not maintain its value through PostBack

It is normal behaviour for an ASP.NET TextBox and other controls similar to it to lose their value through PostBack when they have the Disabled attribute set to True. To work around this behaviour, you can either use a Hidden type of field if you don’t want the user to see the value of the field in the page, or use the ReadOnly property instead of the Disabled property to disallow the user from changing the value of the TextBox.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top