title: ASP.NET MVC Multiple Forms
body: <p>I'm still a beginner at .NET MVC, so please correct me if I'm doing something silly. I'm trying to create an action/view combination that will allow me to display 2 edit forms from 1 linq query. So here's my action:</p>
  
  <pre><code>Function Settings() As ActionResult
      Dim pagetext = (From t In _db.PageTexts _
                      Where t.campus = My.Resources.Campus _
                      Select t)
      Return View(pagetext)
  End Function
  </code></pre>
  
  <p>And here is my view:</p>
  
  <pre><code>&lt;% For Each item As EDKiosk.PageText In Model%&gt; 
  &lt;% Using Html.BeginForm("Settings", "Admin")%&gt;
      &lt;div class="editor-label"&gt;
          &lt;%= Html.LabelFor(Function(model) item.recommend)%&gt;
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          &lt;%= Html.TextAreaFor(Function(model) item.recommend)%&gt;
          &lt;%= Html.ValidationMessageFor(Function(model) item.recommend)%&gt;
      &lt;/div&gt;
  &lt;% End Using %&gt;
  &lt;% Next %&gt;
  </code></pre>
  
  <p>So, my first question is, am I doing that right? Then, my follow-up question is how would my  method handle this data? Thank you in advance!</p>
  
  <p>EDIT:</p>
  
  <p>Per Samuel's suggestion, I reworked my code like this-</p>
  
  <pre><code>&lt;% Dim hidden = New With {Key .type = "hidden"}%&gt;
  &lt;div class="editor-field"&gt;
      &lt;%= Html.TextBox("id", item.id.ToString(), hidden)%&gt;
  &lt;/div&gt;
  
  &lt;div class="editor-field"&gt;
      &lt;%= Html.Label("recommend")%&gt;
      &lt;%= Html.TextArea("welcome", item.recommend.ToString())%&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It works now, but I feel like its still kind of clunky. Thoughts?</p>