date formatting string in vb mvc
How do I format my vb.net mvc date to a shortdate in my view
<td>
<%: Html.DisplayF开发者_如何学编程or(Function(modelItem) currentItem.DateCreated)%>
</td>
Format(date, "MM/dd/YYYY")
I don't know what modelItem is, but i think you are looking to do this
<td>
<%: HTML.DisplayFor(Function(modelItem), Format(currentItem.DateCreated, "MM/dd/YYYY")) %>
</td>
Not sure if thats right, i don't really know what Html.DisplayFor actually does. I've never ran into that before. But the Format(yourdate, shortdateformat) will definitely work
精彩评论