title: asp.net mvc Html helper hidden field behaving strangely
body: <p>The behavior of the HtmlHelper.Hidden eludes me.</p>
  
  <p>This is from a template inside Views/Shared/DisplayTemplates/Test.cshtml. Idea was to output a delete button next to the element in the list. So the view accepts a model of IEnumerable and then uses @Html.EditorForModel() to output each test item.</p>
  
  <p>So if i put this into Test.cshtml:</p>
  
  <pre><code>&lt;input type="hidden" name="Name" value="@Model.Name"/&gt;
  @Html.Hidden("Name2", Model.Name) 
  </code></pre>
  
  <p>That yields this:</p>
  
  <pre><code>&lt;input type="hidden" name="Name" value="test"/&gt; 
  &lt;input id="RoleList_12__Name2" name="RoleList[12].Name2" type="hidden" value="test" /&gt;
  </code></pre>
  
  <p>Why does the name of the Html helper render something different from what i tell it to? I assume that  this is intended, but i don't understand why.</p>
  
  <p><strong>Update</strong></p>
  
  <p>How would i go ahead and retrieve RoleList[12].Name in my controller?</p>
  
  <p>My delete function accepts:</p>
  
  <pre><code>[HttpPost]        
  public ActionResult DeleteRole(Roles.Test model)
  {
  }
  </code></pre>
  
  <p>How can that one accept a RoleList[12] name item? It always returns null if i try.</p>