I tried the Request.IsAjaxRequest but this does not exist in WebForms. I am making a JQuery ajax call. How do I check if this is a ajax request or not in C#?
Decorate your class with [WebMethod(EnableSession = true)]syntax like if you write the following function in code behind and call the same function from ajax call you will be sure.
[WebMethod(EnableSession = true)]
public static void getData(string JSONFirstData,string JSONSecondData, string JSONThirdData, string JSONForthData, ...)
{
//code
}
in Ajax URL be like URL :'/Codebehind.aspx/getData'