随笔分类 -  ASP.NET MVC 5

摘要://https全局配置 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true; 阅读全文
posted @ 2019-12-18 18:52 b̶i̶n̶g̶.̶ 阅读(263) 评论(0) 推荐(0) 编辑
摘要:参考 http://www.cnblogs.com/yaozhenfa/p/asp_net_mvc_route_2.html 说明 1."解决与物理路径的冲突"这段教程这里如果不起作用的话,说明你的web.config缺少 阅读全文
posted @ 2017-07-17 13:46 b̶i̶n̶g̶.̶ 阅读(134) 评论(0) 推荐(0) 编辑
摘要:Web.config 阅读全文
posted @ 2017-02-08 11:47 b̶i̶n̶g̶.̶ 阅读(356) 评论(0) 推荐(0) 编辑
摘要:1 public class TAjaxListLoginValidateAttribute : FilterAttribute, IAuthorizationFilter 2 { 3 public void OnAuthorization(AuthorizationContext filterContext) 4 { 5 ... 阅读全文
posted @ 2016-12-15 10:15 b̶i̶n̶g̶.̶ 阅读(416) 评论(0) 推荐(0) 编辑
摘要:一、Application_End Application_End:网站关闭,或重启时,会触发该方法 二、Application_Start 第一个访问网站的用户会触发该方法. 通常会在该方法里定义一些系统变量,如聊天室的在线总人数统计,历史访问人数统计的初始化等等均可在这里定义 三、Session 阅读全文
posted @ 2016-08-31 13:35 b̶i̶n̶g̶.̶ 阅读(286) 评论(0) 推荐(0) 编辑
摘要:一、同步Link模式 /Home/List/UserId/PageIndex 备注: PageIndex会默认附加到最后一个参数 二、异步事件模式 1.单个视图页的js,事件命名必须是 pager(href, pageindex){} 三、JPager MVC扩展类 阅读全文
posted @ 2016-04-12 09:41 b̶i̶n̶g̶.̶ 阅读(287) 评论(0) 推荐(0) 编辑
摘要:前言CSRF(Cross-site request forgery跨站请求伪造,也被称为“One Click Attack”或者Session Riding,通常缩写为CSRF或者XSRF,是一种对网站的恶意利用。本文使用ASP.NET MVC提供的AntiForgery进行安全验证应用一、自定义F... 阅读全文
posted @ 2015-12-24 16:54 b̶i̶n̶g̶.̶ 阅读(462) 评论(1) 推荐(0) 编辑
摘要:ASP.NET MVC5 Filter重定向问题一、问题描述 1.在Filter中使用直接filterContext.RequestContext.HttpContext.Response.Redirect(url) 会产生 "无法在发送HTTP标头之后进行重定向"。二、解决方案 1. 使用MVC自... 阅读全文
posted @ 2015-12-10 11:38 b̶i̶n̶g̶.̶ 阅读(1073) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2015-06-19 21:09 b̶i̶n̶g̶.̶ 阅读(274) 评论(0) 推荐(0) 编辑
摘要:1. 删除 controller="XX"2. 确保你的工程根目录下的*.htm或*.html文件名在IIS默认文档中存在搞定 阅读全文
posted @ 2015-03-26 15:49 b̶i̶n̶g̶.̶ 阅读(474) 评论(0) 推荐(0) 编辑
摘要://加载计算机上可用的字体 public string LoadFonts() { try { var fontCollection = new InstalledFontCollec... 阅读全文
posted @ 2015-01-14 10:18 b̶i̶n̶g̶.̶ 阅读(312) 评论(0) 推荐(0) 编辑
摘要:概述ASP.NET MVC 5支持一种新的路由协议,称为路由特性。MVC5也支持以前定义路由的方式,你可以在一个项目中混合使用这两种方式来定义路由。案例 1.使用Visual Studio 2013 创建一个 4.5.1的 Web 项目,选择MVC框架2.配置RouteConfig.cs 附图: ... 阅读全文
posted @ 2014-12-18 17:55 b̶i̶n̶g̶.̶ 阅读(2294) 评论(2) 推荐(2) 编辑