Working with Blog Categories in Razor Views
In this example, a blog post can be associated with multiple categories (MVC3, Razor, etc.). To allow editors to select which categories apply to a blog, the view loops through all available categories and renders a checkbox for each one.