how to detect when a page is called using ajax in asp.net mvc ?
According to the Professional ASP.NET MVC 1.0 book, the MVC AJAX library will insert a form field called "X-Requested-With" with a value of "XMLHttpRequest".
You can then use an extension method in System.Web.Mvc that means you can simply call Request.IsAjaxRequest()
and get a simple true or false saying if this is an AJAX request.