jQuery DatePicker MVC4 EditorFor

后端 未结 3 921
盖世英雄少女心
盖世英雄少女心 2021-01-02 10:17

I need to use datepicker on an EditorFor field.

My code for the view is:

@Html.Label(\"birthDate\",\"birthDate
3条回答
  •  梦毁少年i
    2021-01-02 10:51

    EditorFor accept a class for me

    @Html.EditorFor(model => model.Birthday, new { htmlAttributes = new { @class = "datepicker",@Name="birthday",@PlaceHolder = "mm/dd/yyyy" } })
    

    Html markup

    class="datepicker text-box single-line"
    

    The Class is work.

提交回复
热议问题