title: DataType(DataType.Password)] is being ignored when i am rendering a list of @Html.Editor("["+i2.ToString()+"].PASSWORD")
body: <p>I am working on an asp.net mvc-4 web application. and i have the following model class:-</p>
  
  <pre><code>public class ACCOUNTLIST
      {
          public string ACCOUNTNAME { set; get; }
  
          [DataType(DataType.Password)]
          public string PASSWORD { set; get; }
  
  
          [System.ComponentModel.DataAnnotations.Compare("PASSWORD")]
          [DataType(DataType.Password)]
          public string ConfirmPASSWORD { set; get; }
  
          public string NOTES { set; get; }
      }
  </code></pre>
  
  <p>where i am rendering a list of empty model classes as follow:-</p>
  
  <pre><code>for(int i2 = start; i2 &lt; count ; i2++) 
  { 
  
  &lt;div &gt;@Html.DisplayName("["+i2.ToString()+"].PASSWORD") 
  @Html.Editor("["+i2.ToString()+"].PASSWORD") 
  @Html.ValidationMessage("["+i2.ToString()+"].PASSWORD") 
  &lt;/div&gt;
  
  &lt;div &gt;@Html.DisplayName("["+i2.ToString()+"].ConfirmPASSWORD") 
  @Html.Editor("["+i2.ToString()+"].ConfirmPASSWORD")
  @Html.ValidationMessage("["+i2.ToString()+"].ConfirmPASSWORD")
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>now the the problem i am facing is that the generated fields from the @Html.Editor will not hide the text being entered using dotted circles .. so seems the <code>[DataType(DataType.Password)]</code> will not have any effect inside the <code>@Html.Editor("["+i2.ToString()+"].PASSWORD) &amp; @Html.Editor("["+i2.ToString()+"].ConfirmPASSWORD)</code>. and the related fields will be renders as follow:-</p>
  
  <pre><code>&lt;input name="[0].ConfirmPASSWORD" class="text-box single-line valid" type="text" value=""&gt;
  </code></pre>
  
  <p>?? can anyone adivce on this please?</p>