I have a view that loads a partial view from a controller action using jQuery. The controller action is decorated with the Authorize attribute and if the user has timed out
For Simen Echholt second solution you can use
$.ajaxSetup({ global: true, statusCode: { 401: function () { alert("unauthorized"); } } });
to bind some your function on status code 401