Friday, June 6, 2008

How to Change ASP.Net Calendar Control to show Next Month

if we place a Calendar Control in ASP.NET page, its Shows current month and date.Then how can we set that month in to next month?, its possible to set current month to next month, the following c# code that change this month problem.

C# ASP.NET code to Change to set month vale to next month

DateTime nextMonth = DateTime.Now.AddMonths(1);
Calendar1.TodaysDate = nextMonth;
DateTime nextOfNextMonth = DateTime.Now.AddMonths(2);
Calendar2.TodaysDate = nextOfNextMonth;


Anonymous said...

Fantastic! Many Thanks!

Innovative Web Developer said...

Thanks a lot for this post. It helps me a lot... :)