コード例 #1
0
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "carousel slide");
            writer.AddAttribute("data-ride", "carousel");
            writer.AddAttribute("data-interval", this.Interval.ToString());
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "carousel-indicators");
            writer.RenderBeginTag(HtmlTextWriterTag.Ol);

            for (int i = 0; i < this.CarouselTemplate.Count; i++)
            {
                if (i == 0) writer.AddAttribute("class", "active");
                writer.AddAttribute("data-slide-to", i.ToString());
                writer.AddAttribute("data-target", string.Format("#{0}", this.ClientID));
                writer.RenderBeginTag(HtmlTextWriterTag.Li);
                writer.RenderEndTag();
            }

            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "carousel-inner");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            base.Render(writer);

            writer.RenderEndTag();

            #region Carousel Control

            #region Carousel Control Prev

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "left carousel-control");
            writer.AddAttribute(HtmlTextWriterAttribute.Href, string.Format("#{0}", this.ClientID));
            writer.AddAttribute("data-slide", "prev");
            writer.RenderBeginTag(HtmlTextWriterTag.A);

            #region Glyphicon Prev

            Glyphicon glyphiconPrev = new Glyphicon();
            glyphiconPrev.GlyphiconType = this.GlyphiconPrev;
            glyphiconPrev.RenderControl(writer);

            #endregion

            writer.RenderEndTag();

            #endregion

            #region Carousel Control Prev

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "right carousel-control");
            writer.AddAttribute(HtmlTextWriterAttribute.Href, string.Format("#{0}", this.ClientID));
            writer.AddAttribute("data-slide", "next");
            writer.RenderBeginTag(HtmlTextWriterTag.A);

            #region Glyphicon Next

            Glyphicon glyphiconNext = new Glyphicon();
            glyphiconNext.GlyphiconType = this.GlyphiconNext;
            glyphiconNext.RenderControl(writer);

            #endregion

            writer.RenderEndTag();

            #endregion

            #endregion

            writer.RenderEndTag();
        }
コード例 #2
0
        protected override void Render(HtmlTextWriter writer)
        {
            if (this.GlyphiconType != GlyphiconTypes.None)
            {
                //<div class="input-group">
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                //  <span class="input-group-addon glyphicon glyphicon-lock"></span>
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group-addon");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, string.Format("glyphicon {0}", Glyphicon.GetGlyphiconCss(this.GlyphiconType)));
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                //writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();
                writer.RenderEndTag();
            }

            base.Render(writer);

            if (this.GlyphiconType != GlyphiconTypes.None)
            {
                //</div>
                writer.RenderEndTag();
            }
        }
コード例 #3
0
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "carousel slide");
            writer.AddAttribute("data-ride", "carousel");
            writer.AddAttribute("data-interval", this.Interval.ToString());
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "carousel-indicators");
            writer.RenderBeginTag(HtmlTextWriterTag.Ol);

            for (int i = 0; i < this.CarouselTemplate.Count; i++)
            {
                if (i == 0)
                {
                    writer.AddAttribute("class", "active");
                }
                writer.AddAttribute("data-slide-to", i.ToString());
                writer.AddAttribute("data-target", string.Format("#{0}", this.ClientID));
                writer.RenderBeginTag(HtmlTextWriterTag.Li);
                writer.RenderEndTag();
            }

            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "carousel-inner");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            base.Render(writer);

            writer.RenderEndTag();

            #region Carousel Control

            #region Carousel Control Prev

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "left carousel-control");
            writer.AddAttribute(HtmlTextWriterAttribute.Href, string.Format("#{0}", this.ClientID));
            writer.AddAttribute("data-slide", "prev");
            writer.RenderBeginTag(HtmlTextWriterTag.A);

            #region Glyphicon Prev

            Glyphicon glyphiconPrev = new Glyphicon();
            glyphiconPrev.GlyphiconType = this.GlyphiconPrev;
            glyphiconPrev.RenderControl(writer);

            #endregion

            writer.RenderEndTag();

            #endregion

            #region Carousel Control Prev

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "right carousel-control");
            writer.AddAttribute(HtmlTextWriterAttribute.Href, string.Format("#{0}", this.ClientID));
            writer.AddAttribute("data-slide", "next");
            writer.RenderBeginTag(HtmlTextWriterTag.A);

            #region Glyphicon Next

            Glyphicon glyphiconNext = new Glyphicon();
            glyphiconNext.GlyphiconType = this.GlyphiconNext;
            glyphiconNext.RenderControl(writer);

            #endregion

            writer.RenderEndTag();

            #endregion

            #endregion

            writer.RenderEndTag();
        }