I have a textbox for date. It has calender control extender to select date. I want to keep this textbox type protected. i.e. user must enter date by selecting date from calender control only and not allowed to type the date. I tried to keep textbox read-only but it is not solving the purpose..
How can I do so…???
I have a textbox for date. It has calender control extender to select date.
Share
I’m suspect that there is a problem with
ReadOnlyproperty that textbox loses his state on postback. Try to usereadonlyattribute instead of theReadOnlyproperty. Fot that purpose add following code to Page_PreRender method:TextBox1.Attributes["readonly"] = "readonly";