Format Date On Binding (ASP.NET MVC)

后端 未结 12 738
感情败类
感情败类 2021-01-31 08:46

In my ASP.net MVC app I have a view that looks like this:

...

<%=Html.TextBox(\"due\")%>
...

I am usi

12条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-31 09:25

    Why don't you use

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

提交回复
热议问题