public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var cook = HttpContext.Current.Request.Cookies["cc"];
if (IsLogin == false)
{
// 异步
var res = HttpContext.Current.Response;
if (HttpContext.Current.Request.Headers["X-Requested-With"] == "XMLHttpRequest")
{
if (cook == null)
{
//????这里要怎么触发 父窗体的 js事件呢?? 这样写毫无效果,一直纠结。
HttpContext.Current.Response.Write("top.getElementById('ajaxon').onclick();");
HttpContext.Current.Response.End();
}
}
// 同步
if (HttpContext.Current.Request.Headers["X-Requested-With"] == null)
{
}
return;
}
}