title: MVC razor password required field issue in New or Edit scenario
body: <p>Model:</p>
  
  <pre><code>[StringLength (50 , ErrorMessage = "Password: Exceeds Size" )]
  public string Password
  {
      get;
      set;
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code> @Html.LabelFor(m =&gt; m.Password)
   @Html.PasswordFor(m =&gt; m.Password)
    @{ Html.ValidateFor(m =&gt; m.Password); }
  </code></pre>
  
  <p>This is my model &amp; view, but the password fields are not populated in edit mode(ie; could not assign the password value from DB to this password field) because of security issues. But the unobtrusive javascript validation was working fine. Since we have the edit issue, as i googled i got solution to replace the view as below;</p>
  
  <pre><code>@Html.LabelFor(m =&gt; m.Password) 
  &lt;input type="password" name="Password" id="Password" value="@Model.Password" /&gt;
  @{ Html.ValidateFor(m =&gt; m.Password); }
  </code></pre>
  
  <p>But this not raising my required validation set in model. Also found that since the data-val properties are not binded- the unobtrusive JS validation is not working for this password field.</p>
  
  <p>All other validation working fine. Can i have a resolution for this issue.?</p>