我尝试在 txtDateTime 中显示当前日期时间 如何在 asp.net 中使用 Maked Edit Extender Ajax 工具包在文本框中显示当前日期时间或自定义日期时间
<asp:TextBox runat="server" ID="txtDateTime" ValidationGroup="ModalPopup"></asp:TextBox>
<asp:CalendarExtender runat="server"
TargetControlID="txtDateTime"
PopupPosition="TopRight"
Format="dd/MM/yyyy HH:mm">
</asp:CalendarExtender>
<asp:MaskedEditExtender runat="server"
ID="meeDateTime"
TargetControlID="txtDateTime"
Mask="99/99/9999 99:99"
MaskType="DateTime"
UserDateFormat= "DayMonthYear"
UserTimeFormat="TwentyFourHour"
CultureDateFormat="DMY"
CultureDatePlaceholder="/" CultureTimePlaceholder=":">
</asp:MaskedEditExtender>
protected void Page_Load(object sender, EventArgs e)
{
//txtDateTime.Text = DateTime.Now.ToString("dd/MM/yyyy H:mm);
//txtDateTime.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm);
txtDateTime.Text = DateTime.Now.ToString();
}
后面的代码