代码之家  ›  专栏  ›  技术社区  ›  saurabh

如何在一个页面中使用多个ajax日历

  •  0
  • saurabh  · 技术社区  · 8 年前

    我正在尝试使用日历插入日期。不幸的是,我不得不使用多个日历。为了从日历中提取日期,我使用了Ajax工具包

    `<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>`
    

    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" EnableScriptGlobalization="true" EnableScriptLocalization="true" runat="server"> </cc1:ToolkitScriptManager> 如果我只使用一个ToolkitScriptManager和多个Ajax日历控件,只单击一个图像按钮来显示日历,那么页面上的所有日历都会弹出。

    1 回复  |  直到 8 年前
        1
  •  1
  •   Stefano Losi    8 年前

            <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>`