i have a textbox
one calender control
on selecting date from calender control date goes in format "Aug 19, 2011" ("MMM dd, yyyy") into textbox
i want the regular expression that if user input date directly into textbox than regular expression is in format Aug 19, 2011 ("MMM dd, yyyy") or not.
actualy i wanted that there should be no option for manual entry into the textbox, but when i use readonly or enabled property and try to insert value into database then null value is retrieved from textbox
nyway, the regular expression will do...
can nyone help
Loading
VulpesPosted Aug 19, 2011, 7:20 AM
Frankly, it's easier to use the DateTime.TryParse() method rather than a regular expression for this.
VulpesPosted Aug 20, 2011, 9:12 AM
In fact, I've just tried it myself and the Text property of a readonly Textbox saved to disk just fine.
My suspicion therefore is that the problem is something to do with how you're saving it to the database rather than the readonly status of the TextBox itself.
nishant ranjanPosted Aug 19, 2011, 8:14 AM
VulpesPosted Aug 19, 2011, 7:49 AM
What do you get when you do:
MessageBox.Show(textBox1.Text);
nishant ranjanPosted Aug 19, 2011, 7:20 AM
VulpesPosted Aug 19, 2011, 7:05 AM