How to keep the Text of a Read only TextBox after PostBack()?

前端 未结 7 1131
伪装坚强ぢ
伪装坚强ぢ 2020-12-08 07:05

I have an ASP.NET TextBox and I want it to be ReadOnly. (The user modify it using another control)

But when there is a PostBack()

7条回答
  •  温柔的废话
    2020-12-08 08:01

    Set the ContentEditable property of textbox to false ContentEditable="false".. It wont allow you to edit the contents of the textbox ie;will make the textbox readonly and also will make the value stay in the textbox after postback.. I think its the easiest way to do it..

提交回复
热议问题