Skip to content

Instantly share code, notes, and snippets.

@josephwoodward
Last active August 29, 2015 14:25
Show Gist options
  • Save josephwoodward/6a820275961b79562de7 to your computer and use it in GitHub Desktop.
Save josephwoodward/6a820275961b79562de7 to your computer and use it in GitHub Desktop.
Write to section in ASP.NET MVC
public static IHtmlString PageHeading(this HtmlHelper html, Icon icon, string title, string subTitle)
{
WebViewPage page = html.ViewDataContainer as WebViewPage;
if (page != null)
{
page.DefineSection("Heading", () => {
page.Write(MvcHtmlString.Create("My Text"));
});
}
return new HtmlString(string.Empty);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment