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

  • Home
  • SEARCH
  • 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 6943857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:12:38+00:00 2026-05-27T13:12:38+00:00

I have been using the jQuery date picker for a while and its great.

  • 0

I have been using the jQuery date picker for a while and its great. however, I’m now using it in a user control and cant get it to work failing with the error:

Object Does Not Support This Property or Method when creating the date picker.

My site structure is as follows:

[Root]
  - [Pages]
     - MasterPage.Master
     - GoodsReceived.aspx
  - [WebControls]
     - [PageControls]
       - PopupBatchEntry.ascx

I have added jQuery to the master page like so:

<link href="../App_Themes/Default/Style.css" rel="stylesheet" type="text/css" />
<link href="../JavaScripts/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="../JavaScripts/jquery.min.js" type="text/javascript"></script>
<script src="../JavaScripts/jquery-ui.min.js" type="text/javascript"></script>

I have added jQuery to the User control like so:

<script src="../../JavaScripts/jquery.min.js" type="text/javascript"></script>
<script src="../../JavaScripts/jquery-ui.min.js" type="text/javascript"></script>

The text boxes im trying to turn in to date pickers is in the user control inside a gridview (css class:datePicker)

<asp:GridView ID="gvBatchDetails" runat="server" AutoGenerateColumns="False" EnableModelValidation="True">
                                    <Columns>

                                        <asp:TemplateField HeaderText="Use By">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtUseBy" runat="server" Text='<%# Bind("UseBy", "{0:dd/MM/yyyy}") %>'
                                                    Width="80px" CssClass="datePicker"></asp:TextBox>
                                                <%--                                                <cc1:CalendarExtender ID="txtUseBy_CalendarExtender" runat="server" 
                                                    Enabled="True" Format="dd/MM/yyyy" TargetControlID="txtUseBy">
                                                </cc1:CalendarExtender>--%>
                                                <asp:RequiredFieldValidator ID="valSellByReq" runat="server" ControlToValidate="txtUseBy"
                                                    ErrorMessage="* Required" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("UseBy", "{0:dd/MM/yyyy}") %>'></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Sell By">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtSellBy" runat="server" Text='<%# Bind("SellBy", "{0:dd/MM/yyyy}") %>'
                                                    Width="80px" CssClass="datePicker"></asp:TextBox>
                                                <%--                                                <cc1:CalendarExtender ID="txtSellBy_CalendarExtender" runat="server" Enabled="True"
                                                    Format="dd/MM/yyyy" TargetControlID="txtSellBy">
                                                </cc1:CalendarExtender>--%>
                                                <asp:RequiredFieldValidator ID="valSellByRequired" runat="server" ControlToValidate="txtSellBy"
                                                    ErrorMessage="* Required" Display="Dynamic"></asp:RequiredFieldValidator>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label4" runat="server" Text='<%# Bind("SellBy", "{0:dd/MM/yyyy}") %>'></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Quantity Delivered">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtQuantityDelivered" runat="server" Text='<%# Bind("QuantityDelivered") %>'
                                                    Width="75px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="valQuantityRequired" runat="server" ControlToValidate="txtQuantityDelivered"
                                                    ErrorMessage="* Required" Display="Dynamic"></asp:RequiredFieldValidator>
                                                <asp:RangeValidator ID="valQuantityRange" runat="server" ControlToValidate="txtQuantityDelivered"
                                                    ErrorMessage="* Invalid" MinimumValue="0" Type="Double" CultureInvariantValues="True"
                                                    Display="Dynamic"></asp:RangeValidator>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label5" runat="server" Text='<%# Bind("QuantityDelivered") %>'></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle HorizontalAlign="Right" />
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:TemplateField>
                                        <asp:TemplateField ShowHeader="False">
                                            <EditItemTemplate>
                                                <table class="BorderlessTable">
                                                    <tr>
                                                        <td>
                                                            <asp:Button ID="Button1" runat="server" CausesValidation="True" CommandName="Update"
                                                                Text="Update" />
                                                        </td>
                                                        <td>
                                                            <asp:Button ID="Button2" runat="server" CausesValidation="False" CommandName="Cancel"
                                                                Text="Cancel" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <table class="BorderlessTable">
                                                    <tr>
                                                        <td>
                                                            <asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Edit"
                                                                Text="Edit" />
                                                        </td>
                                                        <td>
                                                            <asp:Button ID="Button2" runat="server" CausesValidation="False" CommandName="Delete"
                                                                Text="Delete" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>

And finally the jQuery im using to turn the text boxes in to date pickers (in the user control):

//Configure dates when the page is loaded
$(document).ready(configureDates);

//Add handler toend request
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(configureDates);

//Configure all date picker text boxes
function configureDates() {

    var datePickers = $('.datePicker');

    if ($(datePickers).length > 0) {
        $(datePickers).datepicker({ dateFormat: "dd/mm/yy" });   <--- ERROR IS HERE
    }
}

Can anyone see what is wrong with this? I was thinking it could be to do with the paths to the jQuery files depending on whether the current context is in the pages folder, or the web controls folder.

  • 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-05-27T13:12:39+00:00Added an answer on May 27, 2026 at 1:12 pm

    Use ResolveUrl for your script and css refs :

    <link href='<%= Page.ResolveUrl("~/App_Themes/Default/Style.css")%>' rel="stylesheet" type="text/css" />
    <link href='<%= Page.ResolveUrl("~/JavaScripts/jquery-ui.css")%>' rel="stylesheet" type="text/css" />
    <script src='<%= Page.ResolveUrl("~/JavaScripts/jquery.min.js")%>' type="text/javascript"></script>
    <script src='<%= Page.ResolveUrl("~/JavaScripts/jquery-ui.min.js")%>' type="text/javascript"></script>
    
    
    //Configure all date picker text boxes
    function configureDates() {
    
        $('.datePicker').datepicker("option", "dateFormat", "dd/mm/yy");
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using mootools for a year now. I need to use jquery
I been using the jquery ui for quite a while now. This is the
I have been using jQuery lately, but never used JSON with it. Now, I
I have been using jquery 1.3 and upgraded to jQuery 1.6. However I am
I have been using jquery for quite a while. I see people talking about
I have been using jquery ajax method to get the json data. I have
I have been using jQuery for the past couple of years now, and I'm
I have been using jQuery's find method and it's been very useful. However, I
I have been using Jquery alot lately an was wondering if I should use
I'm working on a asp.net mvc2 app. I have been using jquery to do

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.