title: MVC Validation from one model to multiple views
body: <p>I have a problem where I have one Model with validation and need certain error messages to show on different views. At the moment I get validation errors on all views for everything in my Model.</p>
  
  <p>Im guessing there is a way to set individual validation messages depending on which view is showing?</p>
  
  <p>My Model is as follows:</p>
  
  <pre><code>[Required(ErrorMessage = "Confirm name of item")]
  public string ItemName { get; set; }
  [Required(ErrorMessage = "Confirm Number of items")]
  public int NumberOfItems { get; set; }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@using (Html.BeginForm())
  {
  @Html.ValidationSummary()
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;Name:&lt;/td&gt; &lt;td&gt;@Html.TextBox("ItemsName")&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Number:&lt;/td&gt; &lt;td&gt;@Html.TextBox("NumberOfItems")&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I only need one error message showing on another view I have which only has the item name....</p>
  
  <p>Thanks in advance</p>