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

Taskcproblem calendar 4
Calendar control 0
Function Help 1
Calendar Control - Selecting a date in another month 1
Calendar control 1
Calendar Control - Font Style 0
Calendar 1
Calendar appointments by month 2

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top