Creating Custom Html Helper Methods

HTML helper methods are used in Razor views to generate HTML markup in a strongly-typed, C-sharpy way. An example is @Html.LabelFor(m => m.Name), which is used in a strongly-typed view whose model has a Name property. This will generate a label element with the appropriate display name. In this post we will learn how to create a custom HTML helper.

Create Meaningful Classes

In a previous post I talked about the importance of good naming when writing code. The title of that post is "Don't Make Me Think... About Your Code". This post will talk about meaningful classes and can be considered as an addition to the "writing code" series.