Calendar Control - Formatting String

Last post 06-02-2008 6:38 AM by rajeshthangarasu. 3 replies.

Sort Posts:

  • Calendar Control - Formatting String

    06-02-2008, 5:56 AM
    • Member
      9 point Member
    • sunhuman
    • Member since 03-23-2008, 11:22 AM
    • Posts 36

    I use a calendar control to input date into a textbox

    But when selecting the date from Calendar I want to ensure the Date Format shown in textbox appears in this format (January 01, 1900)

    Any hints?

  • Re: Calendar Control - Formatting String

    06-02-2008, 6:21 AM
    • Contributor
      5,590 point Contributor
    • deblendewim
    • Member since 12-20-2006, 4:32 PM
    • Antwerp, Belgium
    • Posts 951

    Hi

    Set the format property of the CalendarExtender to:

    Format="MMMM d, yyyy"

    Kind regards,
    Wim

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Calendar Control - Formatting String

    06-02-2008, 6:28 AM
    Answer
    • All-Star
      60,891 point All-Star
    • anas
    • Member since 09-21-2006, 8:31 AM
    • Palestinian Territory, Occupied
    • Posts 6,865
    • Moderator

     

        Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
            TextBox1.Text = Calendar1.SelectedDate.ToString("MMMM dd, yyyy")
        End Sub
     
    Regards,

    Anas Ghanem | Blog

  • Re: Calendar Control - Formatting String

    06-02-2008, 6:38 AM
    • Participant
      1,672 point Participant
    • rajeshthangarasu
    • Member since 03-14-2008, 3:08 AM
    • Chennai, India
    • Posts 254

     Try this code:

     

    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            TextBox1.Text = Calendar1.SelectedDate.ToString("MMMM dd,yyyy");
        }
      
    Mark as Answer if the post was useful to you

    Rajesh Thangarasu
    Microsoft Certified Technology Specialist (MCTS)
    Microsoft Certified Application Developer (MCAD)
Page 1 of 1 (4 items)