4

How do I know which month is selected when no date is selected.

For eg, on page load, the calendar will show december. The user click ">" button to show January.

How do I know that he has selected January?

Tkz

william
  • 7,284
  • 19
  • 66
  • 106

1 Answers1

3

You can use the VisibleMonthChanged event to identify that.

protected void Cal1_VisibleMonthChanged(object sender, MonthChangedEventArgs e)
{
    //e.NewDate.Month will have the new visible month
}

To obtain the name of the month, check these web pages.

Best way to turn an integer into a month name in c#?

http://www.norecursion.com/blog/archive/2010/05/21/how-to-get-month-name-from-integer.aspx

Community
  • 1
  • 1
Ranhiru Jude Cooray
  • 19,542
  • 20
  • 83
  • 128