Bootstrap日期选择器-ASP NET MVC在我的代码中没有被滥用 [英] Bootstrap Date picker - ASP NET MVC Not excuted in my code

查看:89
本文介绍了Bootstrap日期选择器-ASP NET MVC在我的代码中没有被滥用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与NewspostedDate无关的html页面

This the html page that not work the problem with NewspostedDate

<div class="form-group">
@Html.LabelFor(model => model.NewsPostedDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.NewsPostedDate, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.NewsPostedDate, "", new { @class = "text-danger" })
</div>
</div>

推荐答案

而不是Editorfor,您可以使用TextBoxfor.

instead of Editorfor you can use TextBoxfor.

尝试

  @Html.TextBoxFor(m => m.NewsPostedDate, new { @class = "form-control date-picker" })

  $('.date-picker').datepicker({ format: "yyyy/mm/dd", autoclose: true })

注意:好的方法是先加载css文件,然后加载javascript/jquery.因为用户首先会看到您的用户界面,然后才能与您的用户界面进行交互

Note: Good approach first load you css file , then load javascript/jquery . because user first see you UI , then interact with your UI

这篇关于Bootstrap日期选择器-ASP NET MVC在我的代码中没有被滥用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆