Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8282049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:14:32+00:00 2026-06-08T10:14:32+00:00

I am using AjaxControlToolkit for .Net 4.0 I am having a form with textbox

  • 0

I am using AjaxControlToolkit for .Net 4.0

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.

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>

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) Originally
Software Genius Inc

B) Changed after focus out
Software Genius Inc

Can anybody help me out solve this issue.

Do provide better ideas if any.

Thanks for sharing your wisdom.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:14:34+00:00Added an answer on June 8, 2026 at 10:14 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In have my application configured in asp.net. I am using ajaxcontroltoolkit. After building the
I have an asyncfileupload control that I'm using from the ajaxcontroltoolkit. On the file
I am using Microsofts ASP.NET Ajax HTML editor found here http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/HTMLEditor/HTMLEditor.aspx . When I
I'm using ASP.NET, not the newest one with that clientIdMode stuff. So, the control
HI folks, I have a .net application (vb.net) and I'm using the ajax control
TGIF, I have a website I'm developing which is using ASP.NET masterpage/sitemap/content pages setup.
I'm using the ComboBox from the AjaxControlToolkit v4.1.50731. When it displays on the page,
I have an asp.net content form which contains a couple of textboxes. I need
Greetings! I have an ASP.NET app that scrapes data from a handful of external
I am using the following code to create calendar controls on textboxes that have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.