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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:08:34+00:00 2026-06-07T05:08:34+00:00

I have created one user control to pick date from calendar. I used jquery

  • 0

I have created one user control to pick date from calendar. I used jquery plugin to create it. My problem is when i put user control on aspx page its not working properly. I mean to say if i put two times than only one control working second one gives me an error.. so what will be issue??

Code which i have written to register jquery from code behind file

 string jquery = string.Empty;
    jquery = "window.addEvent('domready', function () { new CalendarEightysix('exampleIII', { 'excludedWeekdays': [0, 6], 'toggler': 'imgClick', 'offsetY': -4 });});   ";


    Page.ClientScript.RegisterStartupScript(typeof(Page), "a key", "<script type=\"text/javascript\">" + jquery + "</script>");

User Control Code.

<script src="JS/mootools-1.2.4-core.js" type="text/javascript"></script>
<script src="JS/mootools-1.2.4.4-more.js" type="text/javascript"></script>
<script src="JS/calendar.js" type="text/javascript"></script>
<link href="CSS/calendar.css" rel="stylesheet" type="text/css" />

<table cellpadding="0">
  <tr>
    <th>
      <asp:Label ID="lblHeading" runat="server" Text="Date"></asp:Label>
    </th>
    <td>
      <input id="exampleIII" name="dateIII" readonly="readonly" type="text" maxlength="10"
        style="padding-right: 15px;" />
      <img src="Images/calendar.gif" alt="" id="imgClick" />
    </td>
  </tr>
</table>

Any idea about this than please help me.
Thanks in advance.

  • 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-07T05:08:37+00:00Added an answer on June 7, 2026 at 5:08 am

    Your issue is for sure because your did not have place dynamic control id in your control, or dynamic javascript initialize. With out change the ID on the more than one usercontrol loading then you have conflict when you try to use javascript.

    To make dynamic IDs you can use the ClientID attribute of the same control.

    On code, the points that you need to make dynamic change are, first of all the input that you select to be simple html control, add at the end of your ID the Current UserControl ID as:

    <input id="exampleIII<%=ClientID%>" name="dateIII<%=ClientID%>" readonly="readonly"
    

    and on

    <img src="Images/calendar.gif" alt="" id="imgClick<%=ClientID%>" />
    

    Then you change your javascript as:

     string jquery = string.Empty;
        jquery = "window.addEvent('domready', function () { new CalendarEightysix('exampleIII"+ ClientID + "', { 'excludedWeekdays': [0, 6], 'toggler': 'imgClick"+ ClientID + "', 'offsetY': -4 });});   ";
    
        Page.ClientScript.RegisterStartupScript(typeof(Page), "akey"+ClientID, "<script type=\"text/javascript\">" + jquery + "</script>");
    

    and load your common javascript library only ones, maybe on master page, or use the Page.ClientScript.RegisterStartupScript

    ps: use the id="exampleIII<%=ClientID%>" to render your controls because the ClientID by him self alone is all ready used. So you get a name a final name with both ClientID and exampleIII.

    An alternative is to make the buttons asp.net controls because using the <%= %> you have issues with UpdatePanels. If you make them asp.net controls then you get the ControlName.CliendID to use on the javascript init

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

Sidebar

Related Questions

I have Created Module and Create One User Control in the Module. Now, How
I have created a user control Calendar of ajax date extender along with a
I have created one user named tuser with create database rights in SQL server
i have created one image but problem is that when i save image from
We have created a User Control for ASP.Net. At any one time, a user's
I have created one user control for multiple file upload , i need to
I have created one user control and need to convert that user control into
I have two User Controls already created now I want to use one as
i have created one login and register view in that view after login user
I have created one jTable. I want to display the data into table from

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.