62,046
社区成员
发帖
与我相关
我的任务
分享
jQuery(function(){
$.post("account/Getlist",function(data){
$("#msg").html(data.msg);
})
})
[AuthorizationFilter]
public ActionResult Getlist()
public class AuthorizationFilter : ActionFilterAttribute {
public override void OnActionExecuting(ActionExecutingContext filterContext) {
if (filterContext.HttpContext.Request.IsAjaxRequest()) {
if (filterContext.HttpContext.Session["User"] == null) {
filterContext.Result = new RedirectResult("/user/user/login");
//我想实现如果用户没有登录 转到登录 页页 这里的代码应该怎么写。。
//Ajax请求无法实现转向
}
}
}
}
@{
Response.Expires = -1;
Response.AddHeader("pragma", "no-cache");
Response.AddHeader("cache-control", "no-cache");
Response.CacheControl = "no-cache";
Response.Cache.SetNoStore();
}