title: two forms with same input id in asp.net mvc
body: <p>I have multiple forms on a page which pass an id to the controller via hidden inputs. As I am using strongly typed views for these I think I need to keep the Id for each of these to be the same. It works currently though I think it's bad practice. How should I handle this? In Django there are form prefix values is there an equivalent?</p>
  
  <p><a href="https://stackoverflow.com/questions/1252826/avoid-duplication-of-form-input-element-id-in-django">Avoid duplication of form input element ID in Django</a></p>
  
  <p>Here are the two forms I am using:</p>
  
  <pre><code>        &lt;form action="/Course/CropImage" method="post"&gt; 
              &lt;input id="CourseId" name="CourseId" type="hidden" value="&lt;%= Model.CourseId %&gt;" /&gt;
              &lt;input id="X" name="X" type="hidden" value="&lt;%= Model.X %&gt;" /&gt;
              &lt;input id="Y" name="Y" type="hidden" value="&lt;%= Model.Y %&gt;" /&gt;
              &lt;input id="W" name="W" type="hidden" value="&lt;%= Model.W %&gt;" /&gt;
              &lt;input id="H" name="H" type="hidden" value="&lt;%= Model.H %&gt;" /&gt;
              &lt;input type="submit" value="Crop" /&gt;
          &lt;/form&gt;
  
          &lt;form action="/Course/UploadImage" enctype="multipart/form-data" method="post"&gt;
              &lt;input id="CourseId" name="CourseId" type="hidden" value="&lt;%= Model.CourseId %&gt;" /&gt;
              &lt;label for="Image"&gt;Select Image:&lt;/label&gt;&lt;input id="Image" type="file" name="Select Image"/&gt;
              &lt;input type="submit" value="Upload" /&gt;
          &lt;/form&gt;
  </code></pre>