RemoteExt 远程验证
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 远程验证的更多相关文章
- MVC验证01-基础、远程验证
本文体验MVC服务端和客户端验证.主要涉及:※ 基础验证※ 远程验证1个或多个属性及注意点 基础体验 创建MVC4的Internet项目,本身包含了基本的Model,Views,Controller. ...
- .NET MV4 Remote远程验证注意事项及案例
首先是模型代码 public class LoginModel { [Required] [Display(Name = "用户名")] [Remote("CheckNa ...
- EasyUI表单验证,自定义插件验证,自定义js插件验证,远程验证,常见手机号,中英文,qq等验证规则验证
{ field : 'startPort', title : "起始端口", editor: "text", width : 50, editor: { ...
- jquery.validate 远程验证remote使用详解
目的: 试了一下远程验证,试了好几次,得出小结,可以记录下,提醒以防绕路. ----------------直接贴图,省事明了---------------- 1.引用js 2.demo的html & ...
- 1)jquery validate 远程验证remote,自定义验证 , 手机号验证 2)bootstrap validate 远程remote验证的方法.
1)jquery validate 远程验证remote,自定义验证 1-1: js <script src="YYFramework/Public/js/jquery-3.1.1. ...
- 在jsp页面中设置了远程验证,在初始化时必须预先调用一次。
参考链接:http://code.taobao.org/p/sztaotao/diff/5/trunk/code/src/main/webapp/webpage/modules/sys/roleFor ...
- MVC3远程验证
public class StudentModel { [Display(Name="学生编号")] public int StuId { set; get; } [Require ...
- asp.net mvc Remote远程验证
1.Model实体 /// <summary> /// 课程编号 /// </summary> [MaxLength()] [Remote("IsUnique_Ava ...
- ASP.NET RemoteAttribute远程验证更新问题
create时使用remote特性没有任何问题, update时,问题就大了,验证唯一性时需要排除自身,如果使用这个特性将无法正确的验证. 改进思路:将自动生成的标签属性改为手写,,并在url上面加上 ...
随机推荐
- nginx 只容许域名访问禁止掉 ip 访问
在原有 nginx server 的基础上再加上相同端口的配置 server { listen 80 default_server; server_name ...
- UOJ117. 欧拉回路【欧拉回路模板题】
LINK 题目大意 就是让你对有向图和无向图分别求欧拉回路 非常的模板,但是由于UOJ上毒瘤群众太多了 所以你必须加上一个小优化 就是每次访问过一个边就把它删掉 有点像Dinic的当前弧优化的感觉 注 ...
- 最佳C/C++编辑器 source insight3
C/C++嵌入式代码编辑器source insight3下载地址 http://www.sourceinsight.com/eval.html 注册码:SI3US-361500-17409
- Redis学习笔记-数据操作篇(Centos7)
一.基本操作 1.插入数据 127.0.0.1:6379> set name cos1eqlg0 OK 这样就在redis中设置了一个key-value键值对 2.查询数据 127.0.0.1: ...
- [Luogu3733][HAOI2017]八纵八横
luogu sol 线性基+线段树分治傻题. 复杂度应该是\(O((n+m\log n)\frac{L^2}{\omega})\)? code #include<cstdio> #incl ...
- 统计中的bitMap
//位图的概念就是在个一字节八位的地方存八个状态 比如 bool hash[] 表示某个数字被标记过,一个数字需要一个字节 而bitMap就是可以把每位都用来标记,起到节约空间的目的 //位图的概念就 ...
- Oracle使用startup与startup force启动的区别
1. startup 就是正常启动数据库,没什么好说的. 2. startup force 是shutdown abort + startup的组合,即强制关闭数据库+ 正常启动数据库,想快速重启数据 ...
- php常量的实现
1.php的常量 就是一个简单的标识符,脚本执行期间不会改变,大小写敏感,默认大写. 常量的存储结构 typedef struct _zend_constant { zval value; //常量值 ...
- Java-Runoob-高级教程-实例-字符串:04. Java 实例 - 字符串替换
ylbtech-Java-Runoob-高级教程-实例-字符串:04. Java 实例 - 字符串替换 1.返回顶部 1. Java 实例 - 字符串替换 Java 实例 如何使用java替换字符串 ...
- ptthon 网络编程
网络编程 网络目的 : 数据的传输 网络数据传输是一个复杂的过程 ISO :国际标准化组织 OSI 七层模型 --> 网络通信标准化流程 应用层 : 提供用户服务,具体内容由特定程序规定 表示层 ...