Model does not apply DataType.Password

后端 未结 2 785
臣服心动
臣服心动 2021-01-17 12:47

Instead of using the object directly, on a simple Razor View I have a form using as it+s model a decorator object.

public class GlobalAccount
{
         


        
2条回答
  •  抹茶落季
    2021-01-17 13:19

    Further to Kieron's answer, in MVC3 it is actually NOT better to use Html.EditorFor for the Password inputs, as for some reason, if the server returns the page (say the username password combo is incorrect) then with EditorFor, the password is transmitted back to the page (and a view source the password is visible)

    When using the Html.PasswordFor the password is not transmitted back to the client.

提交回复
热议问题