I'm using the DatasourceUrl on a grid along with MVC to call a controller method that returns a datatable with data for the grid. The screen I am trying to create is basically a "search" screen, and the search filters are passed as json within the query string to the controller. We have the possibility for a lot of search filters being entered, and when the list gets too long, we get an error saying "Request filtering is configured on the Web server to deny the request because the query string is too long". My question is there another way to use DatasourceUrl or to call an MVC controller method without passing these values in the query string? Can we change the method to be an HttpPost so we can just pass the data, but not as part of the query string?
Right now the MVC controller method has the [GridDataSourceAction] attribute. If I add the [HttpPost] attribute it doesn't work any more (can't find the method).
Hello Ryan,
Thank you for contacting us.
You can call a controller with a simple ajax post request, and also can pass as many you want parameters. For example in button press you can call the controller like this:
Controller:
Looking forward to hearing from you.
We have tried something similar to this in the past but had issues with 1) paging functions on server side, and 2) Using DataTable with AsQueryable. Is there a way around these issues with what you suggested?