It's really quite simple - just check the request header!
if (Request.Headers["X-Requested-With"] != null
&& Request.Headers["X-Requested-With"] == "XMLHttpRequest"){
// if here this is an AJAX Request
}
The point is, take a look at the Headers attribute of the Request and check using the code above.
Hope this post saves someone some time!
No comments:
Post a Comment