摘要:
MVC3缓存之一:使用页面缓存在MVC3中要如果要启用页面缓存,在页面对应的Action前面加上一个OutputCache属性即可。我们建一个Demo来测试一下,在此Demo中,在View的Home目录下的Index.cshtml中让页面输入当前的时间。[csharp] view plaincopy... 阅读全文
摘要:
跨域攻击---自然来路页面和目标页面不在同一个域下,所以直接判断来路域和当前自己的域就可以了。可以广泛应用于表单提交,ajax调用或者某些不想让用户直接输入网址看到的页面[csharp] view plaincopy01.using System; 02.using System.Collecti... 阅读全文
摘要:
代码顺序为:OnAuthorization-->AuthorizeCore-->HandleUnauthorizedRequest 如果AuthorizeCore返回false时,才会走HandleUnauthorizedRequest 方法,并且Request.StausCode会返回401,40... 阅读全文
摘要:
IntroductionIn MVC the default method to perform authorization is hard coding the "Authorize" attribute in the controllers, for each action, in this a... 阅读全文