How server understand it is an ajax request in asp.net? [Resolved]

Posted by Programmer123 under ASP.NET on 12/23/2013 | Points: 10 | Views : 827 | Status : [Member] | Replies : 2
When Ajax request is sent to server then, How server understand it is an ajax request and not the genera asp.net request?
Can any one tell me?




Responses

Posted by: kgovindarao523-21772 on: 12/24/2013 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
Hi,

AJAX requests are normal GETs or POSTs, so unless you or your AJAX library(like jQuery) are adding an additional header(for eg: "X-Requested-With") in the request, there is no way to differentiate for certain whether it is AJAX call or not.

Thank you.

Thank you,
Govind

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 12/24/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
See the below link:-

http://stackoverflow.com/questions/3864179/how-to-know-if-the-request-is-ajax-in-asp-net-mvc

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response