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 6237201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:59:00+00:00 2026-05-24T10:59:00+00:00

I started using Date Picker, and liked it very much. But now I am

  • 0

I started using Date Picker, and liked it very much. But now I am facing a problem with it.
I have an ASP.Net application. I have a Master Page, and a Default.aspx page, and several user controls (.ascx pages). In one of those user controls, I have a GridView with textboxes containing dates. Those textboxes use datepickers. The GridView is in an UpdatePanel. I use custom paging for the GridView. When e.g. I need to go to the next page, that UpdatePanel is updated. The problem is that when I go from the initial page to another page, the date pickers disappear.
Here is my code:
At the bottom of the master page:

<script type="text/javascript"> 
$(document).ready(function() {
    $("input.date").datepicker({ 
        showButtonPanel: true, 
        dateFormat: 'mm/dd/y', 
        changeYear: true, 
        closeText: 'X' 
    });
});
</script>

In the GridView:

<asp:TextBox ID="txtWFHCDate" runat="server" Text='<%#Eval("StrHCDate") %>' BorderStyle="None" Width="80%" CssClass="date" ></asp:TextBox> 

The html generated for the initial GridView page:

<input id="ctl00_CPHDefault_tcTPS_TPProd_ctl01_tcProduction_TPWorkflow_WorkflowGridView_ctl05_txtWFHCDate" class="date hasDatepicker" type="text" style="border-style:None;width:80%;" value="10/18/11" name="ctl00$CPHDefault$tcTPS$TPProd$ctl01$tcProduction$TPWorkflow$WorkflowGridView$ctl05$txtWFHCDate">

The html generated after changing GridView page:

<input id="ctl00_CPHDefault_tcTPS_TPProd_ctl01_tcProduction_TPWorkflow_WorkflowGridView_ctl05_txtWFHCDate" class="date" type="text" style="border-style:None;width:80%;" value="10/18/11" name="ctl00$CPHDefault$tcTPS$TPProd$ctl01$tcProduction$TPWorkflow$WorkflowGridView$ctl05$txtWFHCDate">

I tried to move the script from Master Page to the Default.aspx page, and to .ascx page, but nothing helps.

Could you please help?
Thanks.

  • 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-24T10:59:01+00:00Added an answer on May 24, 2026 at 10:59 am

    During page load, your ready() function calls datepicker() to add the necessary bindings to your text inputs. When you change “pages” inside your GridView/UpdatePanel, those text inputs are discarded and replaced with new ones.

    After the UpdatePanel loads the next “page”, you need to call datepicker() again to re-bind the text inputs. You might be able to integrate this into the .ascx control, or use the UpdatePanel callback described here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started using data.table. Indeed it is very fast and quite nice syntax.
I started using NHibernate this week (struggling). I have a small application with 3
So i just started using ASP.NET MVC and i'm really liking it, except i
I'm using a usoft date time picker control in a dialog box. I started
We are working on a .NET application and recently started using Git for version
I have just started using UIDatePicker in my iPad app, but is there a
I started using bundler (which is to my eyes a pure disaster). Now I
i started using nginx upload module (which creates upload files like /tmp/000121545) but i
I started using Zend_Paginator, it works everything fine but I noticed that there is
I have started using emacs org-mode recently to maintain my TODO lists. I have

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.