i have an action method that is called by an ajax call.
The thing is that the authorize action filter is redirecting me right in the case of firefox, but not in IE7. The thing is when i remove the authorize the request is reaching the action method.
What i did is to use the Output cache attribute with the following options: (saw in other stackoverflow question)
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
[Authorize]
But still i have the same issue on IE7 (the redirectio开发者_如何学编程n doesnt work)
I dont know if maybe is an issue on web.config authentication element:
<authentication mode="Forms">
<forms loginUrl="Pages/LoginRegistration" timeout="2880" />
</authentication>
IE caches AJAX GET requests by default. If your initial reply doesn't specify a Cache-Control
header (different than what OutputCache
does -- Cache-Control
controls the browser's cache, not the server's), then IE won't ever request it again, so your authorization does nothing, since the browser never actually talks to the server.
So either include the Cache-Control
HTTP header in your response or use a POST
.
精彩评论