[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

Calendar control: What is the current month being viewed?

I have a calendar control:
<asp:Calendar runat="server" OnDayRender="CalendarDayRender" id="cc" />

Is there a way I can determine what month is currently being viewed?  For example, if the user clicks the Next button and scrolls to the month of "May", how can I determine what month he/she is viewing (in this case, May)?
0
hendridm
Asked:
hendridm
  • 2
  • 2
1 Solution
 
praneethaCommented:
this.Calendar1.SelectedDate.Month
0
 
hendridmAuthor Commented:
I believe that value only changes if the user selects a date, correct?  When the control is first draw, or if the user scrolls through the months, the "SelectedDate" value is set to: 1/1/0001 12:00:00 AM
0
 
sansofturaCommented:
You can use - cc.SelectedDate.Month - try it in SelectionChanged event.
0
 
praneethaCommented:
Calendar1.TodaysDate.Month that displayed the month on the calendar..since by def it shows month of taday's date..

0
 
sansofturaCommented:
Try the event VisibleMonthChanged ()
e.NewDate.Month should give the new month
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now