Is the any way to find out that a request is a normal request (request such as postback operation or redirect or form submit) or an Ajax request?
I am using JQuery lib to send a request and call a Web Method
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that you are using Web Forms and Update Panels here is what we use:
More general method would be to check for the X-Requested-With header in the request.
What is better for you depends on your scenario. Do you want to detect if the page is executing a partial update or you want to know if the browser requested it via XMLHttpRequest?
Another option when using JavaScript to make the AJAX call is to pass a query string parameter indicating that you are making an AJAX call.