Show Date Selected in ASP Calendar on Button Click Event
HI all, I Have a Asp.n开发者_JAVA百科et ASP calander and a 2 button on my page on my first button's Text is "1 Month" and second button's text is "1 Year",Now when I click on the "1 Month" then in my calander the one month later date from now is selected and highlighted with different color, similar when I clik on the "1 Year" Button now that date is selected in my calander which is after one year come from now.
Here's the code required to add one month to the selected date.
DateTime newDate = Calendar1.SelectedDate.AddMonths(1);
Calendar1.VisibleDate = newDate;
Calendar1.SelectedDate = newDate;
精彩评论