How to get html helper password to display password if validation fails

I have a form for creating a new account, and it has a password field. I use presentation models to transfer data to the controller action and back to the form. When the user enters his data and presses the "Submit" button, if the verification fails and returns to the same view that is returned to the view model, he will not enter the default password for input.

How can i do this? Or should I even try?

+3
source share
1 answer

You can set a password after verification by explicitly calling:

<%= Html.Password("Pwd", Model.Pwd) %>

, , , , , .

+2

Source: https://habr.com/ru/post/1748746/


All Articles