这是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>
什么是探测器,我正在使用VS 2010! 并在Web.config
<system.web>
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-GB"
/>
.........................
答案 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" />