摘要:
MVC中经常会用到关于设置访问权限的问题: 如果我们扩展了AuthorizeAttribute,那么我们只需要在类或方法前加上此attribute,即可实现权限问题。 AttributeTargets 权限适用于类或者方法 阅读全文
摘要:
MVC中经常会用一些服务端对Model的验证。 服务端验证要继承自ValidationAttribute,并重写IsValid虚方法来自定义自己的验证规则。 比如上边校验字符串不能少于指定字符,否则show出来用户自定义的message。 阅读全文
摘要:
public class QeurySort { public static IList Sort(IList list,string sidx,string sord) { switch (sord) { case "asc": ret... 阅读全文