title: MVC3 Helper DisplayFor Model
body: <p>I've got a view that displays a list of items. Rather than display items in a grid, I'd like to display 4 items per page, each with an image and multiple properties, displayed in a unique layout.</p>
  
  <p>So, I'd like a foreach to iterate through the items, and each item to get displayed in a div.  I could put all the code in the loop, but I'd like to have a custom html helper extension to do this.</p>
  
  <p>I came up with this,</p>
  
  <pre><code>public static MvcHtmlString DisplayViewerFor(this HtmlHelper helper, TestModel model, bool rightAligned = true) {
          if (model == null) {
              model = new TestModel();
          }
  
          var outterDiv = new TagBuilder("div");
          outterDiv.AddCssClass(rightAligned ? "item-display-right" : "item-display");
  
          var image = new TagBuilder("image");
          image.Attributes.Add("src", "Item/GetImage/" + model.ItemName);
          image.Attributes.Add("height", "150");
  
          var editorLabel = new TagBuilder("div");
          editorLabel.AddCssClass("editor-label");
  
  
          //LOOKING TO ADD CODE LIKE THIS HERE
  
          var labelContent= html.LabelFor({my model property here})
          editorLabel.InnerHtml += labelContent;
  
          //END OF ADD
  
  
          return new MvcHtmlString(outterDiv.ToString(TagRenderMode.EndTag));
      }
  </code></pre>
  
  <p>In my method above, I need to display a few more values, and I would like to use the Html.LabelFor and Html.DisplayFor helpers, but the methods aren't available and I'm not sure what to pass to them if they were. </p>
  
  <p>I'm not sure if this is possible or not, but I thought I would ask.</p>
  
  <p><strong>EDIT</strong>
  I'm trying to use the html.LabelFor.  See my code where I have updated it above, adding to it these two lines.</p>
  
  <pre><code>var labelContent= html.LabelFor({my model property here})
  editorLabel.InnerHtml += labelContent;
  </code></pre>
  
  <p>You can see the code above.</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Here is the planned use for this Helper with dummied down view.</p>
  
  <p>@model TestItemDisplayList</p>
  
  <p>@{
      ViewBag.Title = "Items";
      Layout = "~/Views/Shared/_Layout.cshtml";
  }</p>
  
  <p>@foreach(var item in @model.Items){
      @Html.DisplayViewerFor(item)
  }</p>