Exemplo n.º 1
0
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void RenderContent(HtmlTextWriter output)
        {
            DbContentCommentManager    m = new DbContentCommentManager();
            DbContentCommentCollection dbContentCommentCollection = m.GetCollection(string.Empty, string.Empty);

            // Render Header Row
            this.headerLockEnabled = true;
            RenderRow(this.HeaderRowCssClass, );

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DbContentComment dbContentComment in dbContentCommentCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", dbContentComment.ID.ToString());
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent++;

                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void RenderContent(HtmlTextWriter output)
        {
            DbContentCommentManager    m = new DbContentCommentManager();
            DbContentCommentCollection dbContentCommentCollection = m.GetCollection(string.Empty, string.Empty);
            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DbContentComment dbContentComment in dbContentCommentCollection)
            {
                if (dbContentComment.ID == selectedID)
                {
                    rowCssClass = selectedRowCssClass;
                }
                else if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteFullBeginTag("tr");
                output.WriteLine();
                output.Indent++;
                //
                // Render ID of Record
                //
                // output.WriteBeginTag("td");
                // output.WriteAttribute("class", rowCssClass);
                // output.Write(HtmlTextWriter.TagRightChar);
                // output.Write(dbContentComment.ID);
                // output.WriteEndTag("td");
                // output.WriteLine();
                //
                // Render Main Representation of Record
                //
                output.WriteBeginTag("td");
                output.WriteAttribute("valign", "top");
                output.WriteAttribute("class", rowCssClass);
                output.Write(HtmlTextWriter.TagRightChar);

                if (selectEnabled)
                {
                    output.WriteBeginTag("a");
                    output.WriteAttribute("href", "javascript:" + GetSelectReference(dbContentComment.ID));
                    output.Write(HtmlTextWriter.TagRightChar);
                    output.Write(dbContentComment.ToString());
                    output.WriteEndTag("a");
                }
                else
                {
                    output.Write(dbContentComment.ToString());
                }

                output.WriteEndTag("td");
                output.WriteLine();
                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }