title: Model Binding MVC3 Razor, How do I change input name?
body: <p>I have setup a basic model binder by passing in a list to a view and running:</p>
  
  <p>Controller:</p>
  
  <pre><code>[Authorize]
  public ActionResult AddTracks(int id)
  {
      TrackRepository trackRepository = new TrackRepository();
      //ShowTrackAssociationHelper showTrack = new ShowTrackAssociationHelper();
  
      //showTrack.tracks = trackRepository.GetAssociatedTracks(id).ToList();
      //showTrack.show = showRepository.GetShow(id);
      TracksViewModel tracksModel = new TracksViewModel();
      tracksModel.Tracks = trackRepository.GetAssociatedTracks(id);
  
      ViewBag.ShowID = id;
      return View(tracksModel);
  
  
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code> @model BluesNetwork.Models.TracksViewModel
   @Html.EditorFor(model =&gt; model.Tracks, "TrackEditor")
  </code></pre>
  
  <p>TracksView Model:</p>
  
  <pre><code>public class TracksViewModel
  {
  
      public IEnumerable&lt;Track&gt; Tracks  { get; set; }
  
  }
  </code></pre>
  
  <p>TackEditor:</p>
  
  <pre><code> @model BluesNetwork.Models.Track
  @using (Html.BeginForm())
  {
      @Html.ValidationSummary(true)
  
  
          @Html.HiddenFor(model =&gt; model.TrackID)
          @Html.HiddenFor(model =&gt; model.ShowID)
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(x =&gt; x.Title)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Title)
              @Html.ValidationMessageFor(model =&gt; model.Title)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.TrackNumber)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.TextBoxFor(model =&gt; model.TrackNumber, new { maxlength = 2 })
              @Html.ValidationMessageFor(model =&gt; model.TrackNumber)
          &lt;/div&gt;
              @Html.HiddenFor(model =&gt; model.HQFileID)
              @Html.HiddenFor(model =&gt; model.LQFileID)
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.InternalRating)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.InternalRating)
              @Html.ValidationMessageFor(model =&gt; model.InternalRating)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.License)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.License)
              @Html.ValidationMessageFor(model =&gt; model.License)
          &lt;/div&gt;
  
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.LicenseNumber)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.LicenseNumber)
              @Html.ValidationMessageFor(model =&gt; model.LicenseNumber)
          &lt;/div&gt;
  
          &lt;input type="submit" value="Save" /&gt;
  
  
  
  
  
  }
  </code></pre>
  
  <p>At first I was getting:</p>
  
  <p>Which gives me output as such on each input:</p>
  
  <p>name="[0].ShowID"</p>
  
  <p>however I wanted it to be:</p>
  
  <p>name="track[0].ShowID"</p>
  
  <p>I've seen examples/tutorials that show output like this but they don't go into detail about it.</p>
  
  <p>After following RPM1984's advice and making the changes I got the error:</p>
  
  <p>The model item passed into the dictionary is of type 'System.Data.Objects.ObjectQuery`1[BluesNetwork.Models.Track]', but this dictionary requires a model item of type 'BluesNetwork.Models.Track'.</p>
  
  <p>Thank you in advance for all help</p>
  
  <p>At </p>