Asp.Mvc 2.0用户登录实例讲解---(4)服务器端验证(7)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:13 点击:次
get;
set;
}
}
/// <summary>
/// 此自定义类用于验证密码和确认密码必须一致
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public class PwdMatch :ValidationAttribute
{
private object _typeid = new object();
public string PWD { get; set; }//密码
public string ConfirmPwd { get; set; }//确认密码
public PwdMatch(string pwd, string confirmPwd)
: base()
{
PWD = pwd;
ConfirmPwd = confirmPwd;
}
/// <summary>
/// 返回错误的提示信息
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public override string FormatErrorMessage(string name)
{
return ErrorMessage;
}
/// <summary>
/// 重写TYPEID
/// </summary>
public override object TypeId
{
get
{
return _typeid;
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>