I have a textbox which had readonly property set to true.
This textbox is used to take LongDate as it's input from a pop up calender. When i click on the button, it gives an error
"String was not recognised as valid datetime"
But when i set the textbox's readonly property to false it works completely alright, it returns values fromthe database.
Here is the code which i used
TextBox date_search = (TextBox)Page.PreviousPage.FindControl("tbMyDate"); DateTime dateData; dateData = Convert.ToDateTime(date_search.Text.Trim()); TextBox2.Text = dateData.ToLongDateString();
Why does it work when the readonly property is set to false????