开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜