Calendar Control Question

  • Thread starter David Hamilton via .NET 247
  • Start date
D

David Hamilton via .NET 247

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
 
K

Ken Cox [Microsoft MVP]

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]


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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top