I have a MVC action that can either return a RedirectToAction (302) or a partial view. I'm using Ajax.BeginForm and an OnSuccess handler to capture the response. My problem is, whenever a redirect response is issued, it seems something (not sure if it's a native AJAX behavior or not) is handling the redirect and returning the redirected page, INSTEAD of the response containing the 302 headers. It's essentially bypassing the 302 response and automatically retrieving the redirected page. This isn't what I want.
My goal, with the response, was to look at the headers in the OnSuccess event and gracefully handle either a redirect or a partial view update of the current page.
Is there any way to return a "raw" 302 response? Thanks.