Skip to content

Instantly share code, notes, and snippets.

@joecorcoran
Created December 10, 2009 15:59
Show Gist options
  • Save joecorcoran/253413 to your computer and use it in GitHub Desktop.
Save joecorcoran/253413 to your computer and use it in GitHub Desktop.
// Start of code
protected override void RenderContents(HtmlTextWriter writer)
{
// Writing a simple h1
// You have to prepare your tag attributes before opening the tag
writer.AddAttribute(HtmlTextWriterAttribute.Id, "my_h1");
// Open h1 tag
writer.RenderBeginTag(HtmlTextWriterTag.H1);
// Write contents of h1
writer.Write("My heading");
// Close h1 tag
writer.RenderEndTag();
writer.Close();
}
// End of code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment