摘要:
缓存依赖文件或文件夹 //创建缓存依赖项 CacheDependency dep = new CacheDependency(fileName);//Server.MapPath(""); //创建缓存 HttpRuntime.Cache.Insert(key, obj, dep); fileNam 阅读全文
摘要:
前言当我们访问某个网站的时候需要检测用户是否已经登录(通过Session是否为null),我们知道在WebForm中可以定义一个BasePage类让他继承System.Web.UI.Page,重写它的OnInit()方法,在OnInit()中判断Session中是否有用户登录的信息 在mvc下该怎样 阅读全文
摘要:
MVC过滤器类型:Authorization(授权),继承IAuthorizationFilter接口,用于限制进入Controller或ActionAction(行为),继承IActionFilter接口,用于进入Action之前或之后的处理Result(结果),继承IResultFilter接口 阅读全文
摘要:
@Styles.Render("~/Content/css")//在head中引用css @Scripts.Render("~/bundles/modernizr")//在head中引用js @Html.ActionLink("LinkText", "ActionName", "Controller 阅读全文
摘要:
Client Credentials Grant的授权方式就是只验证客户端(Client),不验证用户(Resource Owner),只要客户端通过验证就发access token。 举一个对应的应用场景例子,比如我们想提供一个“获取网站首页最新博文列表”的WebAPI给iOS App调用。 由于 阅读全文
摘要:
指定数据连接,指定表名,移除表名复数化(表名后面不加s),设置字段约束,主外键关系。 阅读全文
摘要:
数据注解 using System.ComponentModel.DataAnnotations; KeyAttribute 唯一主键StringLengthAttribute 字符串长度约束MaxLengthAttribute 最大长度ConcurrencyCheckAttribute 并发检查属 阅读全文
摘要:
[RemoteExt("IsValidUId", "RVMdEmployee", "", AdditionalFields = "__DS", ErrorMessageResourceName = "G_DuplicatedKey", ErrorMessageResourceType = typeo 阅读全文
摘要:
style="overflow:hidden;text-overflow: ellipsis;white-space:nowrap;word-break:keep-all;" 阅读全文
摘要:
js输出/获得Cookie 阅读全文