1
有人可以解釋爲什麼屬性IsRequestBeingRedirected
在我的代碼中始終爲false,以及如何正確重定向以獲取真實值?Response.IsRequestBeingRedirected始終爲假
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);
if (filterContext.RequestContext.HttpContext.Response.IsRequestBeingRedirected)
{
//some another logic
}
//some code
filterContext.RequestContext.HttpContext.Response.Redirect(filterContext.RequestContext.HttpContext.Request.Url.AbsolutePath);
}
我只是試圖編寫邏輯來檢測瀏覽器在運行時是否禁用了Cookie。我不知道如何通過另一種方式實現此目的。 – user3818229
如果您在Google上搜索,則已有許多cookie檢查解決方案。 [這一個](http://stackoverflow.com/questions/3716710/how-to-check-cookie-enabled-for-the-browser-or-not#4149481)看起來很有前途。 – NightOwl888