Nov 27, 2015, 1:51 PM
[Ext.Net.Mvc v3.2.1] Compare password issue
Hello,
It seems that the password validation is not working. Code below.
It seems that the password validation is not working. Code below.
using System;
using System.ComponentModel.DataAnnotations;
namespace ExtNetTest.Test.Models
{
public class ChangePasswordModel
{
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
[DataType(DataType.Password)]
[Compare("Password", ErrorMessage = "Not valid")]
public string ConfirmPassword { get; set; }
}
}
using System.Web.Mvc;
using Ext.Net;
using Ext.Net.MVC;
using ExtNetTest.Test.Models;
using System.Collections.Generic;
namespace ExtNet.Test.Controllers
{
public class ExtNetController : Controller
{
public ActionResult Index()
{
return this.View();
}
public ActionResult Submit(ChangePasswordModel model)
{
return this.FormPanel(ModelState);
}
}
}
@model ExtNetTest.Test.Models.ChangePasswordModel
@{
Layout = null;
var X = Html.X();
}
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
@(Html.X().ResourceManager().Theme(Theme.CrispTouch).ScriptMode(Ext.Net.ScriptMode.Debug))
@(X.FormPanel()
.Url(Url.Action("Submit"))
.Width(500)
.Height(500)
.Layout("vbox")
.Items(
X.TextFieldFor(m => m.Password, false),
X.TextFieldFor(m => m.ConfirmPassword, false)
)
.Buttons(
X.Button()
.Text("Submit")
.Handler("this.up('form').getForm().submit();")
)
)
</body>
</html>