Mariusz, Gorzoch tech Blog

Archive for September 2011

jqGrid and passing parameters to ASMX from ASP.Net Web.Forms

leave a comment »

If you like me decided to build you service layer based on asmx then quite soon you will find that passing parameters from jqGrid to it is not so obvious think. Here is a short description how to grab data from your web form and pass it to back end asmx service thru jqGrid.

In nut shell the way how you can do it is by passing those parameters thru query string parameter to your asmx service. Please find below example of the aspx page with grid.

1. Let’s assume that we have those three filters we want to pass to asmx


2. Code of jqGrid will looks like this


Notice here that I’m placing parameters into the url param of jqGrid. Once you filter get change you will have to update value of that parameter and then call refresh grid function. Here is a screen showing how this can be done:


I hook above function to click even on “Search” button.

3. In below section you can see how to retrieve query parameters values on the server side (actually there is no magic here):



hope I save your time if you were looking for this.


Written by Mariusz Gorzoch

18 September 2011 at 13:34

Posted in Bez kategorii