Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

What is output.RenderEndTag

Tag is used while creating the Custom COntrol. While form renders it Creates HTML and convert the controls in the HTML Tags.

while creating Custom COntrol, It creats the HTML tag i.e. Span (depending upon the nature of tag) having id. In that What we write output.RenderEndTag() at the end so that This span tag can be close.
If we will not write the output.RenderEndTag(). The tag will not have closing tag.


protected override void RenderContents(HtmlTextWriter output)
// output.Write(Text);
output.AddAttribute(HtmlTextWriterAttribute.Href, "");
output.AddStyleAttribute("font-size", "20px");
output.AddStyleAttribute("color", "#000000");
output.AddStyleAttribute("font-weight", "Bold");
output.AddStyleAttribute("text-decoration", "none");
// output.RenderEndTag();


Without output.RenderEndTag() It will show in HTML side:

< span id="WebCustomControl1_1">
< a href=""
style="font-size: 20px; color: rgb(0, 0, 0); font-weight: bold;
text-decoration: none;">< /a>
Have you noticed that Span tag have not end

Share this article   |    Print    |    Article read by 3207 times
Rohit kakria
I am software developer
Related Articles: No related article
Related Interview Questions: No related interview question