0

フィールドのデータピッカーをアクティブにしようとしていますが、それは起こっていません。MVC 5のブートストラップデータピッカーをアクティブにできませんVisual Studio 2015

BundleConfig.cs:

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
        "~/Scripts/bootstrap.js", 
        "~/Scripts/moment.js", 
        "~/Scripts/bootstrap-datetimepicker.js", 
        "~/Scripts/respond.js")); 

     bundles.Add(new StyleBundle("~/Content/css").Include(
        "~/Content/bootstrap.css", 
        "~/Content/bootstrap-datetimepicker.css", 
        "~/Content/site.css")); 

_Layout.html:

$(function() { 
$('.datetimepicker').datepicker(); 
スクリプトフォルダ内のdatepickerready.jsを作成し

@Scripts.Render("~/bundles/jquery") 
@Scripts.Render("~/bundles/bootstrap") 
@RenderSection("scripts", required: false) 

});

そして最後に、私は日付ピッカーを使用できるようにしたいれるビュー:

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

は私が間違って何をしているのですか?解決策を見つけた

+0

datepickerready.jsに電話をするのを忘れた解決策を見つけた:datepickerready.jsに電話をするのを忘れました – Stefan

答えて

関連する問題