Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Retrieve iggrid filter data with post request
posted

Hi

   I want to send my filtering data to server-side through the post request, currently, i changed iggrid request type to post and call iggridfiltering function,, the request is ok and in the console, data is also in request payload, but in server side when I retrieve data through 'Request',

The request object is null, how can I retrieve post request data of igrid filtering on the server side?

  • 200
    Offline posted

    Hello Ayesha,

    After you have set the RequestType to "POST" and the type of the Filtering to “remote” you can handle the request using the body. In MVC this would look similar to this:

    Stream req = HttpContext.Request.InputStream;
    
        req.Seek(0, SeekOrigin.Begin);
    
        string json = new StreamReader(req).ReadToEnd();
    
        Dictionary<string, string> query = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
    

    In case you have additional questions feel free to ask them.