Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class HeaderHelper
- {
- public static MvcHtmlString StandardHeader(this HtmlHelper htmlHelper,
- string title,
- string description="")
- {
- var tbSection= new TagBuilder("div");
- tbSection.AddCssClass("page-header");
- var tbTitle = new TagBuilder("h2") {InnerHtml = title};
- if (!string.IsNullOrEmpty(description))
- {
- var tbDescription = new TagBuilder("p") {InnerHtml = description};
- tbSection.InnerHtml = string.Concat(tbTitle, tbDescription);
- }
- else
- {
- tbSection.InnerHtml = tbTitle.ToString();
- }
- return MvcHtmlString.Create(tbSection.ToString());
- }
- }
- @Html.StandardHeader("View Employees")
- @Html.StandardHeader("Edit Employee","...some description...")
- @Html.StandardHeader(ViewBag.Title)
- @Html.StandardHeader(ViewBag.Title.ToString())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement