After I found this in our code, I realized a few things:

* "get it done now, get it right later" has a limit
* I don't actually know where this goes with MVC3

```
@model int
@using Company.Core.Logic.Financial
@using Company.Core.Repositories
@{
     var values = from AccountPlan e in new AccountPlanRepository().GetItemList()
                  where String.IsNullOrEmpty(e.PromoCode) // filter out promotional plans
                  select new { id = e.AccountPlanId, name = e.Description };
     var items = new SelectList(values, "id", "name", Model);
 }

@Html.DropDownListFor(m => m, items)

```

This specifically is an editor template (`@Html.EditorFor(m => m.AccountPlan)`), but it made me realize that I don't know where this kind of code goes for common things like menu-builders. If you're using Layouts for MVC3 (and who isn't), where is the code for building a menu across the top based on the user's roles? I'd imagine the view code would be iterating through pre-built menu items and HTML-ifying them, but since the Model is strong-typed, does that mean that all Models need to have knowledge of the menu items?

For once, this is where Webforms made more sense to me, since this would go in the CodeBehind, but I really want to get away from that.

edit: even though I started asking about Layout code, I'm under the assumption it works for EditorTemplates and DisplayTemplates as well. If this is an incorrect assumption, please let me know where these are supposed to go.

edit2: What I ultimately want is to have a clean, possibly even dependency-injectable place to run code that's called from an `EditorTemplate`. Perhaps this is a case where the EditorTemplate calls immediately into a RenderAction?