【问题标题】:change date format of calendar extender using Dropdownlist in asp.net在 asp.net 中使用 Dropdownlist 更改日历扩展器的日期格式
【发布时间】:2015-01-30 06:54:32
【问题描述】:

我想制作一个程序,让您可以选择要使用的日期格式。 我不知道如何在扩展器中选择日期后更改日历扩展器的日期格式属性,具体取决于我在DropDownList1 中选择的格式。我应该使用OnClientDateSelectionChanged(),但它只在客户端运行有没有办法使用javascript更改扩展器的日期格式属性?请帮忙。

<asp:ImageButton ID="imgPopup" ImageUrl="images/calendar.png" ImageAlign="Bottom" runat="server" />

<cc1:CalendarExtender ID="Calendar1" PopupButtonID="imgPopup" runat="server" TargetControlID="txtDate">

</cc1:CalendarExtender>

<asp:DropDownList id="DropDownList1" runat="server">
   <asp:ListItem value="value">
      dd/MM/yyyy
   </asp:ListItem>
<asp:ListItem value="value1">
      MM/dd/yyyy
 </asp:ListItem>
</asp:DropDownList>

【问题讨论】:

    标签: c# asp.net drop-down-menu date-format calendarextender


    【解决方案1】:

    尝试使用此代码更改模板。 它对我有用。

    <ajax:CalendarExtender ID="CEtxtFromDueDate" runat="server" Enabled="True"  
     CssClass="cal_Theme1" Format="dd/MM/yyyy" PopupButtonID="txtFromDueDate" 
     TargetControlID="txtFromDueDate">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-03
      • 2021-08-11
      相关资源
      最近更新 更多