private string GetNavigationValue(bool ignoreCache) { CSBooster_DataContext csb = new CSBooster_DataContext(Helper.GetSiemeConnectionString()); string CacheKey = string.Format("{0}_{1}_{2}_{3}", NavigationID, CultureHandler.GetCurrentNeutralLanguageCode().ToLower(), udc.UserRole.ToLower(), (int)NavType); string navXml = Cache[CacheKey] as string; if (navXml == null || ignoreCache) { navXml = "<Tree/>"; var Navi = csb.hisp_Navigation_GetPreChache(NavigationID.ToGuid(), CultureHandler.GetCurrentNeutralLanguageCode(), udc.UserRole).FirstOrDefault(); if (Navi != null) { navXml = Navi.NPC_PreCacheXML; } navXml = DataAccess.Business.Navigation.TranformXML(navXml, NavType); Cache.Insert(CacheKey, navXml); } UserDataInfo udi = Cache["UID_" + udc.UserID] as UserDataInfo; if (udi == null || ignoreCache) { udi = new UserDataInfo(udc.UserID); Cache.Insert("UID_" + udc.UserID, udi, null, DateTime.Now.AddMinutes(5), System.Web.Caching.Cache.NoSlidingExpiration); } navXml = navXml.Replace("##NEW_MAIL_COUNT##", udi.UnreadMessagesCount.ToString()).Replace("##FRIEND_REQUEST_COUNT##", udi.FriendRequestCount.ToString()).Replace("##ALERT_COUNT##", udi.AlertCount.ToString()); navXml = navXml.Replace("##CURRENT_PAGE##", Server.UrlEncode(Request.Url.PathAndQuery)); return(navXml); }