问题与MaskedEditExtender [英] Issue with MaskedEditExtender
问题描述
我使用AjaxControlToolkit为.NET 4.0
I am using AjaxControlToolkit for .Net 4.0
我有文本框,显示一个表单/接收日期和时间,MM / DD / YYYY HH:MM格式即美国日期格式,24小时制
I am having a form with textbox that displays/accepts date and time in MM/DD/YYYY HH:MM format i.e. US date format with 24 hour time format.
我已经使用文本框与MaskedEditExtender和MaskedEditValidator。
请看看下面code -
I have used TextBox with MaskedEditExtender and the MaskedEditValidator. Please look at the following code -
<p>
First Date Time :
<asp:TextBox ID="txtDateTime1" runat="server"></asp:TextBox>
<asp:MaskedEditExtender ID="mskDateTime1" runat="server"
Mask="99/99/9999 99:99" MaskType="DateTime" TargetControlID="txtDateTime1"
UserTimeFormat="TwentyFourHour">
</asp:MaskedEditExtender>
<asp:MaskedEditValidator ID="mskValDateTime1" runat="server"
ControlExtender="mskDateTime1" ControlToValidate="txtDateTime1"
IsValidEmpty="False"></asp:MaskedEditValidator>
</p>
<p>
Second Date Time :
<asp:TextBox ID="txtDateTime2" runat="server"></asp:TextBox>
<asp:MaskedEditExtender ID="mskDateTime2" runat="server"
Mask="99/99/9999 99:99" MaskType="DateTime" TargetControlID="txtDateTime2"
UserTimeFormat="TwentyFourHour">
</asp:MaskedEditExtender>
<asp:MaskedEditValidator ID="mskValDateTime2" runat="server"
ControlExtender="mskDateTime2" ControlToValidate="txtDateTime2"
IsValidEmpty="False"></asp:MaskedEditValidator>
</p>
有关在下面显示中给出的上述格式的日期。我正在使用的ToString)格式( -
For showing the dates in above format i am using format in ToString() as given below -
protected void Page_Load(object sender, EventArgs e)
{
txtDateTime1.Text = DateTime.Now.ToString("MM/dd/yyyy HH:mm");
txtDateTime2.Text = DateTime.Now.ToString("MM/dd/yyyy HH:mm");
}
日期和时间显示正常,但在焦点走出文本框时的变化。
The date and time is displayed correctly but when the focus goes out of the textboxes the time changes.
我不知道为什么这种情况发生。
I don't know why this happening.
请看看下面的快照 -
Please look at the following snapshots -
A)本来
A) Originally
B)
B) Changed after focus out
任何人可以帮我解决这个问题。
Can anybody help me out solve this issue.
不要如有提供更好的想法。
Do provide better ideas if any.
感谢您分享您的智慧。
推荐答案
最后,我回答我自己的问题不从开发商收到任何回复。
我发现它实际上是MaskEditExtender一个问题。您可以检查这个讨论。
Finally, i have reply my own question as not received any replies from developers. I found it is actually an issue with MaskEditExtender. You can check this discussion.
这篇关于问题与MaskedEditExtender的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!