private void PopulatePlaceHolder( int numberOfSubjects ) { Main main = (Main)Page.Master; BHLProvider provider = new BHLProvider(); CustomGenericList<CustomDataRow> list = null; String institutionCode = String.Empty; if (this.Request.Cookies["ddlContributors"] != null) institutionCode = this.Request.Cookies["ddlContributors"].Value; String languageCode = String.Empty; if (this.Request.Cookies["ddlLanguage"] != null) languageCode = this.Request.Cookies["ddlLanguage"].Value; // Cache the results of the Subject queries for 24 hours String cacheKey = "TitleTagSelectCount" + numberOfSubjects.ToString() + institutionCode + languageCode; if ( Cache[ cacheKey ] != null ) { // Use cached version list = (CustomGenericList<CustomDataRow>)Cache[ cacheKey ]; } else { // Refresh cache list = provider.TitleTagSelectCountByInstitution( numberOfSubjects, institutionCode, languageCode ); Cache.Add( cacheKey, list, null, DateTime.Now.AddMinutes( Convert.ToDouble( ConfigurationManager.AppSettings[ "SubjectQueryCacheTime" ] ) ), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null ); } // Read the total number of titles from the first row in the result set if (list.Count > 0) totalCount = (int)list[0]["Count"].Value; else totalCount = main.TitlesOnlineCount; foreach ( CustomDataRow row in list ) { if ( row[ "TagText" ].Value != null ) { HyperLink link = new HyperLink(); link.NavigateUrl = "/subject/" + Server.UrlEncode( row[ "TagText" ].Value.ToString() ); link.Text = row[ "TagText" ].Value.ToString(); link.CssClass = GetCssClassForCount( (int)row[ "Count" ].Value ); titleTagCloudPlaceHolder.Controls.Add( link ); Image spacer = new Image(); spacer.ImageUrl = "/images/blank.gif"; spacer.Height = 1; spacer.Width = 4; titleTagCloudPlaceHolder.Controls.Add( spacer ); } } }