How to properly implement “Confirm Password” in ASP.NET MVC 3?

后端 未结 2 825
长发绾君心
长发绾君心 2020-12-23 16:45

There\'s already an answered question about the same subject but as it\'s from \'09 I consider it outdated.

How to properly implement \"Confirm Password\" in ASP.NET

2条回答
  •  难免孤独
    2020-12-23 17:43

    Take a look at the default VS2010 template for a MVC3 app.

    It contains a RegisterModel (a 'ViewModel') that contains the Password and ConfirmPassword properties. The validation is set on the ConfirmPassword.

    So the answer is that the Models in MVC don't have to be (usually aren't) the same as your business Models.

提交回复
热议问题