strange problem with WriteBeginTag

Posted by user276640 on Stack Overflow See other posts from Stack Overflow or by user276640
Published on 2010-03-31T07:52:42Z Indexed on 2010/03/31 8:03 UTC
Read the original article Hit count: 350

Filed under:
|
|
|

i use such code, but it renders with error <li class="dd0"><div id="dt1"<a href="http://localhost:1675/Category/29-books.aspx">Books</a></div></li>

there is no > in opening tag div. what the problem?

writer.WriteBeginTag("li");
                //writer.WriteAttribute("class", this.CssClass);
                writer.WriteAttribute("class", "dd0");
                if (!String.IsNullOrEmpty(this.LiLeftMargin))
                {
                    writer.WriteAttribute("style", string.Format("margin-left: {0}px", this.LiLeftMargin));
                }
                writer.Write(HtmlTextWriter.TagRightChar);
                writer.WriteBeginTag("div");
                writer.WriteAttribute("id", "dt1");
                this.HyperLink.RenderControl(writer);
                writer.WriteEndTag("div");
                writer.WriteEndTag("li");

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about .NET