C# 引导日期选择器;启用月份选择ASP.NET MVC数据批注
我一直在尝试获取用于选择月份的引导文本框;通过使用C# 引导日期选择器;启用月份选择ASP.NET MVC数据批注,c#,asp.net-mvc,razor,twitter-bootstrap-3,datepicker,C#,Asp.net Mvc,Razor,Twitter Bootstrap 3,Datepicker,我一直在尝试获取用于选择月份的引导文本框;通过使用type=“month”来识别。同样可以应用于选择一周type=“week”,带有c#数据注释。 但是,没有运气。 我能够使用以下数据注释创建引导日期选择器 [DataType(DataType.Date)] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")] public virtual DateTime M
type=“month”
来识别。同样可以应用于选择一周type=“week”
,带有c#数据注释。
但是,没有运气。
我能够使用以下数据注释创建引导日期选择器
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public virtual DateTime Month { get; set; }
但是,无法创建用于选择月份的字段。我尝试使用[DisplayFormat(ApplyFormatInEditMode=true,DataFormatString=“{0:MM}”)]
及跟随;;
@Html.EditorFor(m=>m.Month,新的{@Value=Model.Month.ToString(“d”)})
如中所示
这给了我一个不同的错误
请看附件图片;引导月选择器。
注;我用剃须刀看风景
非常感谢你的帮助