Why is the HtmlHead class sealed?
ASP.NET 2.0 gives us a Page.Title property, which we can set in code, or in the Page directive. Great! Unfortunately, I had a requirement so that whilst I'd be setting a portion of the title from the page, the rest would be pre-defined (ideally within the master page that I use). Obviously you can't fiddle the stuff in the server-side title tag, because the contents just gets overriden. So I thought I'd just extend the new System.Web.UI.HtmlControls.HtmlHead class and fiddle the Title property to add the required string to the end Except you can't. Because its sealed. Why? And does anyone have another way to do this?
Comments
Leave a Comment