2017-07-08 2 views
0

J'essaie d'utiliser un calendrier pour insérer des dates. Malheureusement, je dois utiliser plus d'un calendrier. Pour extraire la date du calendrier, j'utilise Ajax ToolkitComment utiliser plusieurs calendriers ajax dans une seule page

`<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" EnableScriptGlobalization="true" EnableScriptLocalization="true" runat="server"> 
      </cc1:ToolkitScriptManager> 

<asp:TextBox ID="DateOfPurchase" runat="server" Height="30px" ReadOnly="true" Width="262px"></asp:TextBox> 

      <asp:ImageButton ID="imgPopup" ImageUrl="images/index.jpg" ImageAlign="Bottom" 
      runat="server" Height="27px" Width="37px" /> 

      <cc1:CalendarExtender ID="Calendar1" PopupButtonID="imgPopup" runat="server" TargetControlID="DateOfPurchase" 
      Format="dd/MM/yyyy"> 
      </cc1:CalendarExtender>` 

Donc chaque fois que j'ajoute plus d'un <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" EnableScriptGlobalization="true" EnableScriptLocalization="true" runat="server"> </cc1:ToolkitScriptManager> mon programme indique l'erreur. Et si j'utilise Un seul ToolkitScriptManager et plusieurs contrôles de calendrier Ajax, en cliquant sur un seul bouton d'image pour afficher le calendrier, tous les calendriers, sur la page, apparaissent.

Répondre

1

Chaque CalendarExtender doit avoir son propre ID

 <asp:ImageButton ID="imgPopup1" ImageUrl="images/index.jpg" ImageAlign="Bottom" 
     runat="server" Height="27px" Width="37px" /> 

     <cc1:CalendarExtender ID="Calendar1" PopupButtonID="imgPopup1" runat="server" TargetControlID="DateOfPurchase1" 
     Format="dd/MM/yyyy"> 
     </cc1:CalendarExtender>` 

 <asp:ImageButton ID="imgPopup2" ImageUrl="images/index.jpg" ImageAlign="Bottom" 
     runat="server" Height="27px" Width="37px" /> 

     <cc1:CalendarExtender ID="Calendar2" PopupButtonID="imgPopup2" runat="server" TargetControlID="DateOfPurchase2" 
     Format="dd/MM/yyyy"> 
     </cc1:CalendarExtender>` 
+0

Merci beaucoup !!. Ça a marché. – saurabh