Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7817115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:07:24+00:00 2026-06-02T06:07:24+00:00

On my MVC3 razor page I have a date field @Html.EditorFor(model => model.Member.Dob) Given

  • 0

On my MVC3 razor page I have a date field

@Html.EditorFor(model => model.Member.Dob)

Given below is the code I am trying to get a datepicker for the Date of Birth field.

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
 <script type="text/javascript">
      $(document).ready(function () {
          debugger;
          $("#Member_Dob").datepicker();
      });
  </script>

But when I run this page I am getting error

Microsoft JScript runtime error: Object doesn't support property or method 'datepicker' 

Please help me find a way to add datepicker to my page

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:07:26+00:00Added an answer on June 2, 2026 at 6:07 am

    You’ll need to create an EditorTemplate in your Views\Shared\EditorTemplate folder. Name it DateTime.cshtml. Should look something like the following:

    @model System.DateTime?
     <div class="editor-label">
        @Html.Label("")
    </div>
    <div class="editor-field">
        @Html.TextBox("", String.Format("{0:MM/dd/yyyy}",(Model == DateTime.MinValue)? null : Model), new { @class="text"})
    </div>
    
    <script type="text/javascript">
        $(document).ready(function () {
            $("#@ViewData.ModelMetadata.PropertyName").datepicker({
                changeMonth: true,
                changeYear: true,
                dateFormat: 'mm/dd/yy',
                gotoCurrent: true
            });
        });
    </script>
    

    Use it as follows:

    @Html.EditorFor(model => model.Member.Dob)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Razor layout MVC3 page as below: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML
With ASP.NET MVC3 (Razor) I have a simple page that loads a jQuery UI
I need to use a static html page as an MVC3 razor masterpage. It
Is it possible in MVC3 (Razor if possible) to have a page rendered with
Using VB.NET with MVC3 and Razor. I have a test page for a custom
I'm using jQuery Validate Unobtrusive with ASP.NET MVC3 Razor. I have a page with
I'm working on an MVC3 Razor web application which gets it's page decoration from
ASP.NET MVC3 Razor project Trying to implement OpenID using http://weblogs.asp.net/haithamkhedre/archive/2011/03/13/openid-authentication-with-asp-net-mvc3-dotnetopenauth-and-openid-selector.aspx I've edited the openid-en.js
New to MVC3 Razor - linq to sql having spent some time trying to
Can you guys please check this code, it is MVC3 Razor <p><strong><u>Skills:</u></strong> @foreach (var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.