Is it possible to perform a redirect when using @Ajax.ActionLink to the login page if the user’s session has expired instead of the login page loading on the view where the Ajax content would be updated? For example is it possible to check the status received from the server in the OnBegin function of the Ajax call?
Is it possible to perform a redirect when using @Ajax.ActionLink to the login page
Share
Phil Haack wrote a nice article about this situation and options to handle it: http://haacked.com/archive/2011/10/04/prevent-forms-authentication-login-page-redirect-when-you-donrsquot-want.aspx
Here is another options where your return object includes a variable to indicate if the result should be redirected, Why jquery ajax calls fails after session timeout in asp.net mvc?.