title: Substitution arguments in ValidationAttribute.ErrorMessage
body: <p>In an ASP.NET MVC 4 app, the LocalPasswordModel class (in Models\AccountModels.cs) looks like this:</p>
  
  <pre><code>public class LocalPasswordModel
  {
      [Required]
      [DataType(DataType.Password)]
      [Display(Name = "Current password")]
      public string OldPassword { get; set; }
  
      [Required]
      [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
      [DataType(DataType.Password)]
      [Display(Name = "New password")]
      public string NewPassword { get; set; }
  
      [DataType(DataType.Password)]
      [Display(Name = "Confirm new password")]
      [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
      public string ConfirmPassword { get; set; }
  }
  </code></pre>
  
  <p>The above code contains two substitution arguments in the ErrorMessage string:</p>
  
  <pre><code>ErrorMessage = "The {0} must be at least {2} characters long."
  </code></pre>
  
  <p>Can someone tell me where the values that get substituted into that string come from?  More generally, is there anything approximating official documentation that describes how parameter substitution works in this context?</p>