I am using a calendar control with ASP.NET to fill in a text box with the selected date.
Here is the code I use to get the date into the text box:
Private Sub Calendar_SelectionChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles calendar.SelectionChanged
calendar.Visible = False
duedate.Text = calendar.SelectedDate.ToShortDateString()
Dim div As System.Web.UI.Control = Page.FindControl("divCalendar")
If TypeOf div Is HtmlGenericControl Then
CType(div, HtmlGenericControl).Style.Add("display", "none")
End If
End Sub
When a date is selected, it goes into the text box and looks like this:
7/3/2009.
The problem is that when I view the gridview that returns the content inserted from that calendar control/text box combo, it looks like this:
Jul 23 2009 12:00AM
I am OK with it showing "Jul 23 2009" but I do NOT want it to show the time on there! The db field is char20.
Any tips really appreciated!