Reputation: 21
The asp.Net Calendar provides Next and Previous buttons over the calendar day name but I don't like it. I am trying to add Next and Previous button outside the calendar just like the Google calendar. Then is it possible to add MonthChangedEventArgs
to the button so I can use it just like OnVisibleMonthChanged
provided by the asp.Net Calendar.
FYI: When you click on the next button then the month changes. Just like when you use
e.NewDate
ande.Previous
fromMonthChangedEventArgsDate
and then use.VisibleDate
to update the calendar
Upvotes: 2
Views: 1500
Reputation: 33153
See this article, I was able to use it to create a drop down box allowing you to select a month. It is better then a button or hyperlink because I can go to December from February without that many clicks. Here is a screen shot:
Here is a working demo for you
The code you are specifically after is:
public void Set_Calendar(object Sender, EventArgs E)
{
cntCalendar.TodaysDate = Convert.ToDateTime(drpCalMonth.SelectedItem.Value + " 1, " + drpCalYear.SelectedItem.Value);
}
Upvotes: 2