protected override void OnInit(EventArgs e) { LandingRepository landingRepository = new LandingRepository(); landingPage = landingRepository.GetLandingPage(GeneralExtensions.GetQueryStringId()); CommonRepository commonRepository = new CommonRepository(); UserExtensions userExtensions = new UserExtensions(); if (userExtensions.IsUserLoggedIn() && System.Web.HttpContext.Current.Request.RawUrl.Contains("resources")) { ltlServices.Text = commonRepository.GetServices("MemberResourcesCollectionId".GetAppKeyLong()); } else { ltlServices.Text = commonRepository.GetServices(landingPage.ServicesCollectioId.ConvertToLong()); } }
protected void Page_Load(object sender, EventArgs e) { long collectionId = 0; string homeServices = "HomeServices", homeBanners = "HomeBanners"; if (id > 0) { if (contentData != null) { CommonRepository common = new CommonRepository(); //To bind the service module llServicesTitle.Text = homeProperties.serviceTitle; collectionId = homeProperties.serviceCollectionId; string serviceResult = string.Empty; if (HttpContext.Current.Cache[homeServices] == null) { serviceResult = collectionId > 0 ? common.GetServices(collectionId) : string.Empty; HttpContext.Current.Cache.Insert(homeServices, serviceResult, null, DateTime.Now.AddMinutes("CacheDuration".GetAppKeyDouble()), TimeSpan.Zero); } else serviceResult = HttpContext.Current.Cache[homeServices].ToString(); llServicesInfo.Text = serviceResult; //To bind the our clients string xmlString = clientContentView.Model.ContentList.FirstOrDefault().Html; if (!string.IsNullOrEmpty(xmlString)) { this.xmlDataSource.Data = xmlString; this.xmlDataSource.DataBind(); repOurClients.DataSource = xmlDataSource; repOurClients.DataBind(); } //To bind the banner List<HomeBanner> bannerList; if (HttpContext.Current.Cache[homeBanners] == null) { bannerList = homeUtils.GetBanners(contentData.Html); if (bannerList != null) HttpContext.Current.Cache.Insert(homeBanners, bannerList, null, DateTime.Now.AddMinutes("CacheDuration".GetAppKeyDouble()), TimeSpan.Zero); } else bannerList = (List<HomeBanner>)HttpContext.Current.Cache[homeBanners]; //repHomeBanner.DataSource = bannerList != null ? bannerList : null; //repHomeBanner.DataBind(); } } }