I create one ASP web application, in this application one form should update the date value in the text field field. I put a calendar button next to this text box. it can update the date in this text box field, but it can be changed. I want the update date value to be used only with the calendar button, I used the read-only property, but returned an empty value, therefore it does not work.
Try the html attribute readonlyon the client side instead of the ASP.NET server side readonly.
readonly
myTextBox.Attributes.Add("readonly", "readonly");
From MSDN,
TextBox ReadOnly, true, , , . , . Text postbacks, .
readonly .
TextBox1.Enabled = false;
TextBox1.Attributes.Add("readonly","readonly");
, enabled= false, textbox. textbox, textbox.
enabled= false
textbox
:
yourTextBoxName.Attributes.Add("readonly","readonly");
,
Enabled="false"
aspx, .
, :
textBox asp.net
, java-
onkeydown="javascript:return false"
, ,