Wednesday, April 28, 2010

unable to retrieve textbox value in server side when textbox is set readonly

One of the common UI design is to have a couple of textbox and you might want to prevent it from user modifying the value. And the easiest wayout is to set the textbox as readonly or disabled.

Unfortunately, you wont be able to get these 'disabled' or 'read-only' textbox value from server side.

One of the workarounds is to set the readonly condition during runtime instead of design time in asp.net page.

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

No comments:

Post a Comment