我在这里看到了问题,但无法解决问题。
我希望当用户在表单中插入日期时,只有过去的日期才是相关的。
例子:
用户无法插入 2016 年 2 月 3 日之后的日期。
我的型号:
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}", ApplyFormatInEditMode = true)]
[Display(Name = "Date")]
[Required(ErrorMessage = "Date is mandatory")]
public DateTime created_date { get; set; }
Run Code Online (Sandbox Code Playgroud)
我的看法:
<div class="form-group" >
@Html.LabelFor(model => model.created_date, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10" >
@Html.EditorFor(model => model.created_date, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.created_date, "", new { @class = "text-danger" })
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
谢谢。
我的任务是使用PuTTY从某个文件中读取信息.请登录:" 某处 ",您会找到一个名为"INSTUCTIONS"的文件,其中包含如何继续操作的说明.我是怎么做到的 谢谢.