是否可以將確認密碼文本框的文本與 @Html.PasswordFor(model=>model.Password)
比較?在ASP.Net中比較密碼和確認密碼MVC
@using (Html.BeginForm())
{
<table>
<tr>
<td>@Html.LabelFor(model => model.Password)</td>
<td>@Html.PasswordFor(model => model.Password)</td>
<td>@Html.ValidationMessageFor(model => model.Password)</td>
</tr>
@*Here I want to take "Confirm Password" and want to compare it with "Password" in View(.cshtml only) as
I have not taken ConfirmPassword in my model.*@
<tr>
<td>
<input type="submit" value="Create" />
</td>
</tr>
</table>
}
請提出這樣或那樣的解決方案,
如何compare password
和confirm password
沒有得到確認模式密碼屬性。謝謝....
雖然這可能足以大幅限制風險,但客戶端驗證不是真正的驗證... –