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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Calendar Month

Calendar Month

Scheduled Pinned Locked Moved ASP.NET
question
6 Posts 2 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.
  • J Offline
    J Offline
    jamesbronw
    wrote on last edited by
    #1

    Is there a way that i can have the calendar show a different month? I need it to show dates for March not Feburary. Thanks in advanced Tommy

    J 1 Reply Last reply
    0
    • J jamesbronw

      Is there a way that i can have the calendar show a different month? I need it to show dates for March not Feburary. Thanks in advanced Tommy

      J Offline
      J Offline
      Jesse Squire
      wrote on last edited by
      #2

      Yes. Take a look at the Calendar's VisibleDate property in the MSDN documentation. Hope that helps. :) --Jesse

      J 2 Replies Last reply
      0
      • J Jesse Squire

        Yes. Take a look at the Calendar's VisibleDate property in the MSDN documentation. Hope that helps. :) --Jesse

        J Offline
        J Offline
        jamesbronw
        wrote on last edited by
        #3

        I took a look at that but it makes no sense to me at all. I'm really new to the programming environment. Would you or anyone be able to give me an example of how to add just 1 month past the current month on the calendar? I'm trying to do this in the page_load of the webform. Thanks Tommy

        J 1 Reply Last reply
        0
        • J Jesse Squire

          Yes. Take a look at the Calendar's VisibleDate property in the MSDN documentation. Hope that helps. :) --Jesse

          J Offline
          J Offline
          jamesbronw
          wrote on last edited by
          #4

          Ok i got it working. Just one more question. Can you have more than 1 selected range on the calender?

          J 1 Reply Last reply
          0
          • J jamesbronw

            I took a look at that but it makes no sense to me at all. I'm really new to the programming environment. Would you or anyone be able to give me an example of how to add just 1 month past the current month on the calendar? I'm trying to do this in the page_load of the webform. Thanks Tommy

            J Offline
            J Offline
            Jesse Squire
            wrote on last edited by
            #5

            Sure. Lets assume that we have a calendar on the page called "myCalendar". The code may look something like:

            private void Page_Load(object sender, System.EventArgs ea)

            {

            // Add one month to today's date.  No need to worry about

            // months not having the same number of days, .NET will handle

            // that.  For example, adding a month to January 31st gives us

            // a date of February 28th.

            DateTime nextMonth = firstOfThisMonth.AddMonths(1);

            // Set the VisibleDate property of the calendar, so that it will display

            // the month of the date.

            myCalendar.VisibleDate = nextMonth;

            }

            Hope that helps. :) --Jesse

            1 Reply Last reply
            0
            • J jamesbronw

              Ok i got it working. Just one more question. Can you have more than 1 selected range on the calender?

              J Offline
              J Offline
              Jesse Squire
              wrote on last edited by
              #6

              D'OH. Didn't see this reply before I made my previous one. :doh: It appears that you can have multiple ranges selected. For example, assume that we have a calendar control on the page called "myCalendar". The following works for me:

              private void Page_Load(object sender, System.EventArgs ea)

              {

              myCalendar.SelectedDates.Add(DateTime.Parse("02/01/2005"));

              myCalendar.SelectedDates.Add(DateTime.Parse("02/02/2005"));

              myCalendar.SelectedDates.Add(DateTime.Parse("02/03/2005"));

              myCalendar.SelectedDates.Add(DateTime.Parse("02/25/2005"));

              myCalendar.SelectedDates.Add(DateTime.Parse("02/26/2005"));

              myCalendar.SelectedDates.Add(DateTime.Parse("02/27/2005"));

              }

              Hope that helps. :) --Jesse

              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