title: Possible bug in ASP.NET MVC with form values being replaced
body: <p>I appear to be having a problem with ASP.NET MVC in that, if I have more than one form on a page which uses the same name in each one, but as different types (radio/hidden/etc), then, when the first form posts (I choose the 'Date' radio button for instance), if the form is re-rendered (say as part of the results page), I seem to have the issue that the hidden value of the SearchType on the other forms is changed to the last radio button value (in this case, SearchType.Name).</p>
  
  <p>Below is an example form for reduction purposes.</p>
  
  <pre><code>&lt;% Html.BeginForm("Search", "Search", FormMethod.Post); %&gt;
    &lt;%= Html.RadioButton("SearchType", SearchType.Date, true) %&gt;
    &lt;%= Html.RadioButton("SearchType", SearchType.Name) %&gt;
    &lt;input type="submit" name="submitForm" value="Submit" /&gt;
  &lt;% Html.EndForm(); %&gt;
  
  &lt;% Html.BeginForm("Search", "Search", FormMethod.Post); %&gt;
    &lt;%= Html.Hidden("SearchType", SearchType.Colour) %&gt;
    &lt;input type="submit" name="submitForm" value="Submit" /&gt;
  &lt;% Html.EndForm(); %&gt;
  
  &lt;% Html.BeginForm("Search", "Search", FormMethod.Post); %&gt;
    &lt;%= Html.Hidden("SearchType", SearchType.Reference) %&gt;
    &lt;input type="submit" name="submitForm" value="Submit" /&gt;
  &lt;% Html.EndForm(); %&gt;
  </code></pre>
  
  <p>Resulting page source (this would be part of the results page)</p>
  
  <pre><code>&lt;form action="/Search/Search" method="post"&gt;
    &lt;input type="radio" name="SearchType" value="Date" /&gt;
    &lt;input type="radio" name="SearchType" value="Name" /&gt;
    &lt;input type="submit" name="submitForm" value="Submit" /&gt;
  &lt;/form&gt;
  
  &lt;form action="/Search/Search" method="post"&gt;
    &lt;input type="hidden" name="SearchType" value="Name" /&gt; &lt;!-- Should be Colour --&gt;
    &lt;input type="submit" name="submitForm" value="Submit" /&gt;
  &lt;/form&gt;
  
  &lt;form action="/Search/Search" method="post"&gt;
    &lt;input type="hidden" name="SearchType" value="Name" /&gt; &lt;!-- Should be Reference --&gt;
    &lt;input type="submit" name="submitForm" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Please can anyone else with RC1 confirm this?</p>
  
  <p>Maybe it's because I'm using an enum. I don't know. I should add that I can circumvent this issue by using 'manual' input () tags for the hidden fields, but if I use MVC tags (&lt;%= Html.Hidden(...) %>), .NET MVC replaces them every time.</p>
  
  <p>Many thanks.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I've seen this bug again today. It seems that this crops its head when you return a posted page and use MVC set hidden form tags with the Html helper. I've contacted <a href="http://haacked.com" rel="noreferrer">Phil Haack</a> about this, because I don't know where else to turn, and I don't believe that this should be expected behaviour as specified by David.</p>