Convert textbox type to password in asp.net mvc

后端 未结 11 2486
感情败类
感情败类 2020-12-18 18:13

How do I convert a textbox type to password in asp.net mvc?

相关标签:
11条回答
  • 2020-12-18 18:29
     @Html.EditorFor(model => model.Password, 
          "Password",
           new { htmlAttributes = new { @class = "form-control" } })
    
    0 讨论(0)
  • 2020-12-18 18:31
        <div class="editor-field">
            @Html.PasswordFor(model => model.Password, new { htmlAttributes = new { @class = "form-control", placeholder = "Password" } })
            @Html.ValidationMessageFor(model => model.Password)
        </div>
    
    0 讨论(0)
  • 2020-12-18 18:31

    Convert textbox type to password in asp.net mvc

    @Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control", placeholder = "Password", @type="Password" } })
    
    0 讨论(0)
  • 2020-12-18 18:36

    When using a strong-typed view and bootstrap, use the following code to make sure the password field is properly styled:

    @Html.PasswordFor(model => model.Password, new { @class = "form-control" })
    
    0 讨论(0)
  • 2020-12-18 18:39

    You mean <%=Html.Password("test")%>?

    0 讨论(0)
提交回复
热议问题