Gets or sets the custom date format. Uses .NET DateTime format specifiers. "d" = ShortDate. "D" = LongDate. (d = day, M = Month, y = Year).
A string value using .NET DateTime syntax format specifiers. Default value = "d" (ShortDate).
Using the DateFormatproperty provides a great deal of flexibility on how to display dates. Examples include: You could also display the date format in the TextBox when the control first loads to provide a 'hint' to users of the required format. Example:
[CS]
BasicDatePicker1.DateFormat = "Date: MMM d, yyyy"; //Date: Feb 20, 2005
BasicDatePicker1.DateFormat = "M-d-yy"; //2-20-05
BasicDatePicker1.DateFormat = "MMMM yyyy"; //February 2005
[CS]
string myDateFormat = "Date: MMM d, yyyy";
BasicDatePicker1.DateFormat = myDateFormat;
BasicDatePicker1.NullDateText = myDateFormat;
BasicDatePicker Class | BasicFrame.WebControls Namespace | NullDateText