I'm using jQuery Ajax to post and when success get the data and replace some items that's work good if i add some security to the controller like that
[Authorize]
public ActionResult .........
If the user logged in every thing go OK but when the user not logged or not authorized it should be redirected to the login page
As I'm using Ajax and it not ordinary post the user will not redirect to log in window ? What can i do to solve this problem? Or how can i know that the user isn't authorized before post with java to display an alert to tell the user to log in or the role didn't match ?