<script type="text/javascript">
$(document).ajaxComplete(function (event, xhr, options) {
if (xhr.status == 999) {
window.parent.location.href = "/Home/Login";
}
});
</script>
C#后台代码设置,在过滤器里面
context.HttpContext.Response.StatusCode = 999;
context.HttpContext.Response.StatusDescription = "NoLogin";
$(document).ajaxComplete(function (event, xhr, options) {
if (xhr.status == 999) {
window.parent.location.href = "/Home/Login";
}
});
</script>
C#后台代码设置,在过滤器里面
context.HttpContext.Response.StatusCode = 999;
context.HttpContext.Response.StatusDescription = "NoLogin";