Date picker was not working in mvc razor view

Total Post:44

 432  View(s)
Rate this:

I am open a modal popup form but datepicker for DOB was not working.

Here is my code:

<div class="col-md-6">
    <label for="dob">DOB</label>
        <div class='input-group date' id='datetimepicker1'>
            @Html.TextBoxFor(x => x.DOB, "{0:MM/dd/yyyy}", new { @class = "form-control", placeholder = "mm/dd/yyyy" })
                 <span class="input-group-addon">
                    <i class="fa fa-calendar" aria-hidden="true"></i>
                    @Html.ValidationMessageFor(x => x.DOB)

  1. Post:1

    Re: Date picker was not working in mvc razor view

    Hi Harsh,

    I analyzed your code, you are missing javascript code for datepicker.

    After analyzing your code i have found that javascript code for datepicker is been missing in your line of codes.

     Kindly add the given line of codes in your view bottom as following :

        $(function () {
                viewMode: 'days'

      Modified On Dec-06-2017 01:34:06 AM



Enter your email address here always to be updated. We promise not to spam!