If I try to get a partial control via ajax call, and the session has expired, or the user is not authenticated. The server renders the whole site again with the login and master page, new css, etc and sends it back to jquery.
Is there a way to have jquery or mvc know its an ajax call and just return a string or something? I use the attribute tags such as:
public class TheController{
[Authorize]
public ActionResult GetProfileInfo(){
return PartialView("ProfileControl");
}
}
http://beckelman.net/post/2010/04/01/Custom-ASPNET-MVC-Authorization-Attribute-For-Ajax-Requests.aspx