I am trying to stop the Time from showing up in a Birthday Text Field that uses DateTime
My Code: (I'm using the Jquery DatePicker)
<label for="birthday">Birthday:</label>
@Html.TextBox("birthday", (Model.Birthday.ToString()), new { @class = "datePicker" })
The Javascript:
$(document).ready(function () {
$('.datePicker').datepicker({ showOn: 'both', buttonImage: "/content/images/calendar-red.gif" });
});
I have the Model setup for the date:
[DataType(DataType.Date)]
public DateTime? Birthday { get; set; }
Still the Text in the Text box displays:
"8/21/2010 12:00:00 AM"
I want Text in the Textbox to diplay as just:
"8/21/2010"
I have tried everything from:
@inherits System.Web.Mvc.WebViewPage<System.DateTime>
but wont let me do that since I am @using a model
#Birthday
as a selector, afaik the Editor output will add an id with the property name. – Reste