Calendar Control Question

Discussion in 'ASP .Net Web Controls' started by David Hamilton via .NET 247, Jun 16, 2004.

  1. I'm having trouble with the Calendar Class. I'm setting it'sselected date in the page_load event, which is being done. Thebut control doesn't then display the month corresponding to it'sselected date, rather it just displays the current monthinstead. If I surf the control to it's selected date the correctdate is always highlighted.

    What do I have to do to show the correct month?
    Thanks for your time

    David

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>HVetX85jVEu+kt8OhFlUBw==</Id>
     
    David Hamilton via .NET 247, Jun 16, 2004
    #1
    1. Advertising

  2. Hi David,

    Are you remembering to set the visibleDate?

    Private Sub Page_Load _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    If Not IsPostBack Then
    Dim dtNow As Date = DateTime.Now
    Calendar1.SelectedDate = dtNow
    Calendar1.VisibleDate = dtNow
    End If
    End Sub

    Ken
    Microsoft MVP [ASP.NET]


    "David Hamilton via .NET 247" <> wrote in message
    news:...
    I'm having trouble with the Calendar Class. I'm setting it's selected date
    in the page_load event, which is being done. The but control doesn't then
    display the month corresponding to it's selected date, rather it just
    displays the current month instead. If I surf the control to it's selected
    date the correct date is always highlighted.

    What do I have to do to show the correct month?
    Thanks for your time

    David

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>HVetX85jVEu+kt8OhFlUBw==</Id>
     
    Ken Cox [Microsoft MVP], Jun 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    856
    Natty Gur
    Nov 10, 2003
  2. Trint Smith
    Replies:
    2
    Views:
    458
    Trint Smith
    Feb 26, 2004
  3. Shevek
    Replies:
    3
    Views:
    6,052
    Shevek
    Jun 23, 2004
  4. Shevek
    Replies:
    0
    Views:
    395
    Shevek
    Jun 23, 2004
  5. Parthiv Joshi
    Replies:
    1
    Views:
    709
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page