Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Please help with displaying selected date on calendar in asp.net

Please help with displaying selected date on calendar in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Support123
    wrote on last edited by
    #1

    Hi all, i am setting the selected value of a calander like this... calendarDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth) how do you make the calander display this selected date now??? i know the date is correct but i dont know how to display it on the calander? I can write the value to the database and it works fine with the correct value i just dont know how to display it... please help Thank you in advance.

    "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

    C J 2 Replies Last reply
    0
    • S Support123

      Hi all, i am setting the selected value of a calander like this... calendarDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth) how do you make the calander display this selected date now??? i know the date is correct but i dont know how to display it on the calander? I can write the value to the database and it works fine with the correct value i just dont know how to display it... please help Thank you in advance.

      "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      How do you want to display it ? What calendar control are you using ? Why doesn't the SelectedDate property solve your problem ? Is Convert.ToDateTime working ?

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      S 2 Replies Last reply
      0
      • C Christian Graus

        How do you want to display it ? What calendar control are you using ? Why doesn't the SelectedDate property solve your problem ? Is Convert.ToDateTime working ?

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        S Offline
        S Offline
        Support123
        wrote on last edited by
        #3

        i think the convert is working... the thing is... calDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth.ToString()); the date is set correctly on the calender... i can click on the previouse month arrow up to the correct month and see the selected date (as the correct date). When the page is loaded it is displaying the today date not the selected date? how do you specify to show the selected date on the calender itself like it is showing the current date???

        "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

        1 Reply Last reply
        0
        • C Christian Graus

          How do you want to display it ? What calendar control are you using ? Why doesn't the SelectedDate property solve your problem ? Is Convert.ToDateTime working ?

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          S Offline
          S Offline
          Support123
          wrote on last edited by
          #4

          ha ha, never mind... i figured it out... right after this section of code: calDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth.ToString());code> i have added this: `calDateOfBirth.VisibleDate = calDateOfBirth.SelectedDate;` it is working fine now :-) Thank you for your time any way.

          "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

          1 Reply Last reply
          0
          • S Support123

            Hi all, i am setting the selected value of a calander like this... calendarDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth) how do you make the calander display this selected date now??? i know the date is correct but i dont know how to display it on the calander? I can write the value to the database and it works fine with the correct value i just dont know how to display it... please help Thank you in advance.

            "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

            J Offline
            J Offline
            J4amieC
            wrote on last edited by
            #5

            try setting VisibleDate as well asa SelectedDate (you would assume that VisibleDate is set to SelectedDate but it isnt by default!)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups