ASP.NET Calendar Management: Stop Resetting Calendar When Navigating Back to Browser

I have implemented the ASP.NET Calendar control. I use it to display events happening in this area.

PROBLEM

Today is August 18th, so when the calendar loads, August is selected as the current month. If I go to October and then go to another page and then try to go back to the page using the Calendar by clicking the Back to Back button, the calendar resets to August, not October.

Can anyone recommend how I can get around this?

Thank!

+2


source to share


2 answers


Try adding this attribute to your calendar definition in the HTML portion of the page?



EnableViewState="true"

      

0


source


What you described is how it should be, because when you hit the back button, the page loads as a new page, nothing wrong with that.

What you can try:



  • - save month and selected date, cookie or "session variables" or "global variable" while navigating from the page

  • on page load, "try" setting the month and date values ​​to what is stored in let say "session variable".

-1


source







All Articles