hariaspind
asked on
how to format date with Html.TextBoxFor helper ?
how to format date which is displayed using Html.TextBoxFor helper class.
ASKER
I was trying to use the below syntax's.But the formatting is not working .
<%= Html.TextBoxFor(model => model.ExpirationDate, String.Format("{0:MM/dd/yy yy}",
Model.ExpirationDate))%>
<%= Html.TextBoxFor(model => model.ExpirationDate, String.Format("{0:MM/dd/yy
Model.ExpirationDate))%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
You could create a DateTime editor template, which will mean that all dates are edited in the same way.
Have a look at the following which describes how to implement a jquery date picker.
http://elegantcode.com/2009/11/13/using-the-jquery-ui-datepicker-with-asp-net-mvc-2-templates/