コード例 #1
0
        private void CreateBannerDiv()
        {
            HtmlGenericControl newdiv  = null;
            string             festUrl = string.Empty;

            List <FestivalBannerModel> list = exploreFestivalHandler.GetFestivalBanner();

            foreach (var obj in list)
            {
                string id = string.Empty;
                if (string.IsNullOrEmpty(obj.FestivalArtUrl))
                {
                    festUrl = FEST_URL;
                }
                else
                {
                    festUrl = obj.FestivalArtUrl;
                    id      = obj.Id.ToString();
                }

                newdiv = new HtmlGenericControl(DIV);
                newdiv.Attributes.Add(CSS_CLASS, CSS_CLASS_NAME);
                newdiv.InnerHtml = BANNER_DATA1 + id + BANNER_DATA2 + festUrl + BANNER_DATA3;
                divbanner.Controls.Add(newdiv);
            }
        }