コード例 #1
0
        /// <summary>
        /// Page Load Generates Html for slider
        /// </summary>
        /// <param name="sender"> The source of event</param>
        /// <param name="e"> The <see cref="System.EventArgs"/> instance containing event data. </param>
        protected void Page_Load(object sender, EventArgs e)
        {
            SliderDB sdb = new SliderDB();

            rptSliders.DataSource = sdb.AllSliders(this.ModuleID);
            rptSliders.DataBind();

            bool isSliderloaded = false;

            foreach (object itemobj in this.Page.Header.Controls)
            {
                if (itemobj is HtmlGenericControl)
                {
                    HtmlGenericControl item = (HtmlGenericControl)itemobj;
                    if (item.Attributes["SliderCss"] != null && item.Attributes["SliderCss"].ToString() == "yes")
                    {
                        isSliderloaded = true;
                        break;
                    }
                }
            }

            if (!isSliderloaded)
            {
                var IncludeSliderCSS = new HtmlGenericControl("link");
                IncludeSliderCSS.Attributes.Add("type", "text/css");
                IncludeSliderCSS.Attributes.Add("rel", "stylesheet");
                IncludeSliderCSS.Attributes.Add("SliderCss", "yes");
                IncludeSliderCSS.Attributes.Add("href", "/aspnet_client/FlexSlider/owl.carousel.css");
                this.Page.Header.Controls.Add(IncludeSliderCSS);
                this.plcLoadScripts.Visible = true;
            }
        }
コード例 #2
0
 private void LoadSliders()
 {
     gdvSliders.DataSource = sdb.AllSliders(this.ModuleID);
     gdvSliders.DataBind();
 }