nologo
nologo

Reputation: 6328

html.textbox datetime format

is it possible to format a text box at page level (not viewmodel) so a datetime can exclude the time stamp?

i cant edit the viewmodel in this project.. so i have to pass in to the view the viewmodel containing a datetime property.

<%=Html.TextBox("DateOfBirth", Model.DateOfBirth)%><br />

thanks

Upvotes: 0

Views: 2148

Answers (1)

StriplingWarrior
StriplingWarrior

Reputation: 156708

Just format your Model.DateOfBirth:

<%=Html.TextBox("DateOfBirth", Model.DateOfBirth.ToShortDateString())%>

Upvotes: 1

Related Questions