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

前端 未结 7 1133
伪装坚强ぢ
伪装坚强ぢ 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:08

    txtStartDate.Attributes.Add("readonly", "readonly"); on pageload in the best of the best solutions ,instead or Javascripts,hidden variables,cache,cookies,sessions & Caches.

提交回复
热议问题