Is it possible to compare confirm password textbox\'s text with
@Html.PasswordFor(model=>model.Password)
?
@using (Html.BeginForm())
{
It is possible to compare your "Password" text box value with a "Confirm Password" text box value both on client side and server side. The solutions given by others is for confirmation on server side. If you don't want to include "Confirm Password" in your model then you have to compare client side. This can be done through Javascript. Either you can manually write a code to compare or you can include the following script in your .cshtml file. (Assuming you are using Visual Studio to write your code).
Then you should create a field like below:
This will compare your "Password" text box with "Confirm Password" text box and also show an error message if the values in both text box don't match, without you having to write any additional code.
Although, a good practice is to do both client side as well as server side validation.