OnResultExecuted()是异步的吗? (MVC3)

时间:2014-01-13 09:33:33

标签: c# asp.net-mvc-3 events httpcookie

假设OnResultExecuted()中已实施BaseController

  

现在假设我有View我在其上呈现 4 Actions(每个   制作一个ajaxRequest)。

问题:

1.如何执行OnResultExecuted()(按什么顺序)?

2.是同步还是异步?

3.如果我以这种方式删除cookie:

protected override void OnResultExecuted(ResultExecutedContext filterContext)
{
    // Some checks, that assure the cookie existence.
    filterContext.HttpContext.Response.Cookies.Remove(FormsAuthentication.FormsCookieName);

    //** BREAKPOINT **

    // Create new cookie.
    var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, "my cool encrypted data");
    cookie.Expires = DateTime.Now.AddHours(2);
    filterContext.HttpContext.Response.Cookies.Add(cookie);
    base.OnResultExecuted(filterContext);
}

- 然后浏览器检查工具会显示在** BREAKPOINT **?

- 在这4个ajax请求的第二次请求中,cookie仍然存在(不是在页面刷新之后)吗?

非常感谢。

0 个答案:

没有答案
相关问题