jquery - mvc bootstrap datepicker with editor template not working -



jquery - mvc bootstrap datepicker with editor template not working -

i seek utilize implement bootstrap v3 datetimepicker in mvc project not working. below editor templates.

@model datetime? @html.textbox("", model.hasvalue ? model.value.tostring("d") : string.empty)

$(function() { // target input in editor template $('#datepicker').datetimepicker(); }); </script>

i had inculded bootstrap datetimepicker script on _layout.chtml seem cant function

<script src="~/scripts/bootstrap-datetimepicker.js"></script> <script src="~/scripts/bootstrap-datetimepicker.min.js"></script>

this view

@html.labelfor(model => model.enddate, new { @class = "control-label col-md-2" }) @html.editorfor(model => model.enddate)

@html.validationmessagefor(model => model.enddate) </div> </div>

it come out normal datetimepicker if set as

[datatype(datatype.date)] public datetime enddate { get; set; }

you not have include both min.js , .js remove one.

add ~/content/bootstrap-datepicker.css css

@html.labelfor(model => model.enddate) @html.textboxfor(model => model.enddate, new { @class = "form-control datepicker", placeholder = "palce holder of choice" }) @html.validationmessagefor(model => model.enddate)

rest of code work on 1 time u initialize

$(function() { // target input in editor template $('#datepicker').datetimepicker(); });

jquery asp.net-mvc twitter-bootstrap

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -