UPDATE: I have an example Really Empty project template up on GitHub you can look at. I improved on this technique a bit in that one.
When you create a new ASP.NET MVC 3 project, the new project wizard dialog contains several options for different MVC project templates: Empty Internet Application Intranet Application (new in the April 2011 Tools update) There’s a lot of white space in that dialog. To many of you, all that unsullied territory smells like opportunity. When I talk about this dialog,...
Within a Razor view, you have access to a base set of properties (such as Html, Url, Ajax, etc.) each of which provides methods you can use within the view. For example, in the following view, we use the Html property to access the TextBox method. @Html.TextBox("SomeProperty")
Html is a property of type HtmlHelper and there are a large number of useful extension methods that hang off this type, such as TextBox.
But where did the Html property come from? It’s a property of System.Web.Mvc.WebViewPage, the default base type...
ASP.NET 4 introduces a few new extensibility APIs that live the hermit lifestyle away from the public eye. They’re not exactly hidden - they are well documented on MSDN - but they aren’t well publicized. It’s about time we shine a spotlight on them. PreApplicationStartMethodAttribute This new attribute allows you to have code run way early in the ASP.NET pipeline as an application starts up. I mean way early, even before Application_Start. This happens to also be before code in your App_code folder (assuming you have any code in there) has been compiled. To use...