how to know if the request is ajax in asp.net mvc?

There’s also the Request.IsAjaxRequest if you’re using a later version of MVC. I don’t have version 1 anymore so I can’t say if it’s in version 1.

If you need this check in Global.asax.cs try this:
new HttpRequestWrapper(Request).IsAjaxRequest()

Leave a Comment