ASP.NET CalendarExtender无法获得月份?

时间:2015-08-18 06:03:22

标签: asp.net calendar ajaxcontroltoolkit

这是GridView模板中的代码:除日历无法显示月份外,一切正常:示例:2015年8月18日。它只显示:18/00/2015。

<FooterTemplate> 
                                                      <asp:TextBox ID="txtNewLeaveDate" runat="server"   CssClass="textnumber"></asp:TextBox>
                                                        <asp:HyperLink ID="hplNewGetCalendar" 
                                                                NavigateUrl="javascript:void(null)" 
                                                                runat="server">
                                                                <img id="imgNewLeaveDate" alt="" src="/App_Themes/Admin/img/calendar.png" runat="server" />
                                                        </asp:HyperLink>
                                                        <asp:CalendarExtender ID="calNewLeaveDate"
                                                                Format="dd/mm/yyyy"
                                                                Animated="false"
                                                                PopupButtonID="hplNewGetCalendar"
                                                                TargetControlID="txtNewLeaveDate"
                                                                runat="server" />
                                                        <asp:MaskedEditExtender
                                                                ID="meeNewLeaveDate"
                                                                TargetControlID="txtNewLeaveDate" 
                                                                Mask="99/99/9999"
                                                                MessageValidatorTip="true" 
                                                                OnFocusCssClass="MaskedEditFocus" 
                                                                OnInvalidCssClass="MaskedEditError"
                                                                MaskType="Date"
                                                                Century="2000"
                                                                CultureName="en-GB"
                                                                UserDateFormat="DayMonthYear"
                                                                InputDirection="LeftToRight"
                                                                runat="server"/>
                                                        <asp:RequiredFieldValidator ID="rfvtxtNewLeaveDate"
                                                               runat="server" ControlToValidate="txtNewLeaveDate"
                                                                ErrorMessage="Required">*</asp:RequiredFieldValidator> 
</FooterTemplate>

结果: enter image description here

什么是探测器,我正在使用VS 2010! 并在Web.config

<system.web>
    <globalization
           fileEncoding="utf-8"
           requestEncoding="utf-8"
           responseEncoding="utf-8"
           culture="en-GB"

        />
.........................

1 个答案:

答案 0 :(得分:0)

OMG!只需编辑一些东西,它就像一个魅力:

<FooterTemplate> 
  <asp:TextBox ID="txtNewLeaveDate" runat="server"   CssClass="textnumber"></asp:TextBox>
                                                        <asp:HyperLink ID="hplNewGetCalendar" 
                                                                NavigateUrl="javascript:void(null)" 
                                                                runat="server">
                                                                <img id="imgNewLeaveDate" alt="" src="/App_Themes/Admin/img/calendar.png" runat="server" />
                                                        </asp:HyperLink>
                                                        <asp:CalendarExtender ID="calNewLeaveDate"
                                                                Format="dd/MM/yyyy"  Animated="false" 
                                                                PopupButtonID="hplNewGetCalendar"  TargetControlID="txtNewLeaveDate" runat="server" />
                                                        <asp:MaskedEditExtender
                                                                ID="meeNewLeaveDate"
                                                                TargetControlID="txtNewLeaveDate"  Mask="99/99/9999" 
                                                                MessageValidatorTip="true" 
                                                                OnFocusCssClass="MaskedEditFocus" 
                                                                OnInvalidCssClass="MaskedEditError"
                                                                MaskType="Date"
                                                                ClearMaskOnLostFocus="false"
                                                                CultureName="vi-VN"
                                                                UserDateFormat="DayMonthYear"
                                                                runat="server"/>
                                                        <asp:RequiredFieldValidator ID="rfvtxtNewLeaveDate"
                                                               runat="server" ControlToValidate="txtNewLeaveDate"
                                                                ErrorMessage="Required">*</asp:RequiredFieldValidator> 
</FooterTemplate> 

和Web.config

<globalization uiCulture="en-GB" culture="en-GB" />

enter image description here