Tuesday, 21 August 2007

ReadOnly Textbox ViewState in .NET 2.0

In .NET 2.0, behaviour of TextBox has slightly changed. For a TextBox with ReadOnly property set to true then the text is not be posted back to the server side. To set a TextBox read-only and keep the text on post back, use the following to set the readonly property on client site rendering:

TextBoxA.Attributes.Add("readonly", "readonly")

1 comment:

  1. hey..this is not been useful for silverlight.i want for the silverlight

    ReplyDelete