title: Using textbox for in foreach loop or for loop of the Model
body: <p>I have a model in a view which is a list:</p>
  
  <pre><code>public PartialViewResult ParcialAlmacenProductoTerminado()
  {
      var usuario = Fn.usuario_logeado.traerUsuario();
      ViewBag.usuario = usuario;
      List&lt;op&gt; ops = db.op.Where(x =&gt; x.temp != true &amp;&amp; x.revisado == true &amp;&amp; x.calidad == true &amp;&amp; x.calidadRevision == true).ToList();
  
      return PartialView(ops);
  }
  </code></pre>
  
  <p>And in my view I have this in the model area:</p>
  
  <pre><code>@model List&lt;Produccion.Models.op&gt;
  </code></pre>
  
  <p>I want to go through it with a <code>foreach</code> or a <code>for</code> (i already tried both) and create and html.textboxfor.</p>
  
  <p>This is the attempt with the <code>for</code>:</p>
  
  <pre><code>@for (int i = 0; i &lt; Model.Count; i++)
  {
      @Html.TextBoxFor(x =&gt; x.OrdenDeCompra[i], new { @class = "form-control obligatorio " })
  }
  </code></pre>
  
  <p>and the one with the <code>foreach</code>:</p>
  
  <pre><code>@foreach (var p in Model)
  {
      @Html.TextBoxFor(x =&gt; x.OrdenDeCompras, new { @class = "form-control obligatorio "})
  }
  </code></pre>
  
  <p>none of them work</p>