我试图翻一页,使用户能够搜索文章。 可以选择根据<代码>FromDate和限制查询。 两者均为<代码>Datetime
。
请用户在<代码>d后填写。 MM.yyy,因为这在我国是正常的。 在提交表格之后,我可以看到《欧洲刑法》中的日期,而且我想到的是。 但问题是,MVC3假设格式为MM.dd.y
。 我如何能够改变这种状况?
Some code: This is the Razor code I use
<div class="toDate" >
<label>til dato</label>
@Html.TextBoxFor(m => m.DateTo, new { placeholder = "dd.mm.yy" })
</div>
在模式中,我有:
public DateTime DateTo { set; get; }
我已尝试使用编辑稿,但我失去我的持证人文本。
www.un.org/Depts/DGACM/index_spanish.htm 简言之,我如何使我的MVC3模式接受用户关于表格的日间投入。 MM.yyy
If my question isn t clear enough, let me know and I ll try to clarify.
EDIT: It appears that I need some clarification, so I ll try to do that by making a scenario:
- The user enters his search criteria. He sets a DateFrom and a DateTo in two text boxes.
- The form is submitted and posted back to the server.
- On the server the DateTime object is treated on the form MM.dd.yy. I wish for it to be interpreted as dd.MM.yy.
我希望能够提供帮助。