private void LoadActivities() { if (!TimeSpan.TryParse(WebConfigurationManager.AppSettings["CacheActivityRemindersResultTimeout"], out reminderTimeout)) { reminderTimeout = CachedResult <int> .TimeoutOneMinute; } IList <Activity> activityList = Reminders.GetRemindersList(GetSearchOptions()); Page.Session["USER_REMINDER_COUNT_RESULT"] = new CachedResult <int>(reminderTimeout, () => activityList.Count); grdActivityReminders.DataSource = ResultsToDataSet(activityList); grdActivityReminders.DataBind(); }