I created a web control and I want to pass the attributes of the element during the rendering phase. I would prefer to use writer.RenderBeginTag () and RenderEndTag (), but this is the only way I can successfully integrate attributes:
public override void RenderBeginTag(HtmlTextWriter writer)
{
writer.Write("<");
writer.Write(this.Tag);
this.Attributes.Render(writer);
writer.Write(">");
}
Is there any other way to do this without looping through a collection of attributes?
source
share