public class RemoteExtAttribute : RemoteAttribute
{
private string _resourceKey; public RemoteExtAttribute(string action, string controller, string areaName)
: base(action, controller, areaName)
{
base.RouteData["area"] = areaName;
} public RemoteExtAttribute(string action, string controller)
: this(action, controller, "")
{ } public RemoteExtAttribute(string action, string controller, string areaName,string resourceKey, string errMsgResourceKey)
: this(action, controller, areaName)
{
string displayName = EP.GlobalResources.EPLocalization.ResourceManager.GetString(resourceKey);
displayName = string.IsNullOrEmpty(displayName) ? resourceKey : displayName;
string errMsg = EP.GlobalResources.EPLocalization.ResourceManager.GetString(errMsgResourceKey);
errMsg = string.IsNullOrEmpty(errMsg) ? errMsgResourceKey : errMsg;
this.ErrorMessage = string.Format(" [{0}] {1}", displayName, errMsg);
} }

  

/// <summary>
/// 账号唯一性
/// </summary>
public partial class RVMdEmployeeController : MutilLangController
{
[HttpGet]
[OutputCache(Location = OutputCacheLocation.None, NoStore = true)]
public JsonResult IsValidAcc(string Account)
{
Account = Account.CleanCode(30);
bool v = MdEmployee.Count(TblMdEmployee._.Account == Account) >= 1;
return Json(!v, JsonRequestBehavior.AllowGet);
}
}

  

[RemoteExt("IsValidUId", "RVMdEmployee", "", AdditionalFields = "__DS", ErrorMessageResourceName = "G_DuplicatedKey", ErrorMessageResourceType = typeof(EP.GlobalResources.EPLocalization))]

RemoteExt 远程验证的更多相关文章

  1. MVC验证01-基础、远程验证

    本文体验MVC服务端和客户端验证.主要涉及:※ 基础验证※ 远程验证1个或多个属性及注意点 基础体验 创建MVC4的Internet项目,本身包含了基本的Model,Views,Controller. ...

  2. .NET MV4 Remote远程验证注意事项及案例

    首先是模型代码 public class LoginModel { [Required] [Display(Name = "用户名")] [Remote("CheckNa ...

  3. EasyUI表单验证,自定义插件验证,自定义js插件验证,远程验证,常见手机号,中英文,qq等验证规则验证

     { field : 'startPort', title : "起始端口", editor: "text", width : 50, editor: { ...

  4. jquery.validate 远程验证remote使用详解

    目的: 试了一下远程验证,试了好几次,得出小结,可以记录下,提醒以防绕路. ----------------直接贴图,省事明了---------------- 1.引用js 2.demo的html & ...

  5. 1)jquery validate 远程验证remote,自定义验证 , 手机号验证 2)bootstrap validate 远程remote验证的方法.

    1)jquery  validate 远程验证remote,自定义验证 1-1: js <script src="YYFramework/Public/js/jquery-3.1.1. ...

  6. 在jsp页面中设置了远程验证,在初始化时必须预先调用一次。

    参考链接:http://code.taobao.org/p/sztaotao/diff/5/trunk/code/src/main/webapp/webpage/modules/sys/roleFor ...

  7. MVC3远程验证

    public class StudentModel { [Display(Name="学生编号")] public int StuId { set; get; } [Require ...

  8. asp.net mvc Remote远程验证

    1.Model实体 /// <summary> /// 课程编号 /// </summary> [MaxLength()] [Remote("IsUnique_Ava ...

  9. ASP.NET RemoteAttribute远程验证更新问题

    create时使用remote特性没有任何问题, update时,问题就大了,验证唯一性时需要排除自身,如果使用这个特性将无法正确的验证. 改进思路:将自动生成的标签属性改为手写,,并在url上面加上 ...

随机推荐

  1. SqlServer高级特性--存储过程

    需求: 用户需要提交加密数据,提交之后需要解密还原,还原有两种结果:成功和失败! 100个用户,之前7天,判断是否有提交数据,如果有提交有数据,判断是否解密成功(分别存在两个表中).如果没有提交,显示 ...

  2. 《DSP using MATLAB》Problem 2.19

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  3. redis的maxmemory与maxmemory-policy关系

    如果redis配置了maxmemory和maxmemory-policy策略,则当redis内存数据达到maxmemory时,会根据maxmemory-policy配置来淘汰内存数据,以避免OOM.r ...

  4. centos下memcached安装

    memcached是一款高速.分布式的内存缓存系统.其官方主页在http://www.danga.com/memcached/ 1.安装前的准备 要安装memcached,需要有libevent的支持 ...

  5. Java多线程编程核心技术,第五章

    1,Timer timer = new Timer(true)现在是守护进程 2,timer是按照顺的,没有异步 3,timer方法,schedule(TimerTask task, Date fir ...

  6. macdown在mac OS 中的配置

    macdown 用命令行打开.md文件 执行两条命令即可. sudo echo "open -a MacDown \$*" > /usr/local/bin/macdown ...

  7. linux Posix 信号量 三 (经典例子)

    本文将阐述一下信号量的作用及经典例子,当中包括“<越狱>寄信”,“家庭吃水果”,“五子棋”,“接力赛跑”,“读者写者”,“四方恋爱”等 首先,讲 semWait操作(P操作)和semSig ...

  8. maven下载源代码,中文注释乱码的处理方法

    通过maven下载的源码,如果有注释是中文的话,一般会有乱码问题,解决办法如下: Window -> Preferences -> Content Types -> Text -&g ...

  9. 剪贴板增强---Kawvin增强剪贴板_V2.0

    #Persistent SetWorkingDir,%A_ScriptDir% ;设置工作目录 #MaxThreadsPerHotkey ;最大热键数量 #NoEnv ;#Warn #SingleIn ...

  10. Azkaban 使用问题及解决

    什么是Azkaban Azkaban是一款基于Java编写的任务调度系统 任务调度:有四个任务脚A.B.C.D,其中任务A与任务B可以并行运行,然后任务C依赖任务A和任务B的运行结果,任务D依赖任务C ...