代码改变世界

asp.net mvc 在ajax中带上 AntiForgeryToken

2015-07-09 10:13 by jdilt, 389 阅读, 0 推荐, 收藏, 编辑
摘要:为了防止跨站点的请求伪造,asp.net mvc引入了AntiForgeryToken这个东西。原理简单说来就是每个session开始的时候发布一个token,之后的每次请求都会带上这个token,然后服务器端对其进行校验。### 使用方法也很简单1. 在html表单里加入:`@Html.AntiF... 阅读全文

Authentication and Authorization in ASP.NET Web API

2015-06-16 20:40 by jdilt, 169 阅读, 0 推荐, 收藏, 编辑
摘要:### What are authentication and authorization* Authentication is knowing the identity of the user. For example, Alice logs in with her username and pa... 阅读全文

未能加载文件或程序集 Newtonsoft.Json, Version=4.5.0.0

2015-06-16 16:08 by jdilt, 600 阅读, 0 推荐, 收藏, 编辑
摘要:使用httpclient测试webapi的时候客户端报错:> {"未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”或它的某一个依赖项。找到的程序集清单定义与程序... 阅读全文

ASP.NET 5

2015-04-01 14:05 by jdilt, 97 阅读, 0 推荐, 收藏, 编辑
摘要:http://weblogs.asp.net/scottgu/introducing-asp-net-5http://www.asp.net/vnext/overview/aspnet-vnext/grunt-and-bower-in-visual-studio-2015http://www.asp... 阅读全文