title: Jqgrid: how to pass arguments to edit url webmethood
body: <pre><code>&lt;script type="text/javascript"&gt;
                      $(document).ready(function () {
                          $("#jqGrid").jqGrid({
                              url: 'UserRoles.aspx/GetUserRoles',
                              datatype: 'json',
                              mtype: 'POST',
                              colNames: ["User Role Id", "User Role", "Description", "Status"],
                              colModel: [
                                  { name: 'UserRoleId', index: 'UserRoleId', jsonmap: 'UserRoleId', width: 75 },
                                  { name: 'UserRoleName', index: 'UserRoleName', jsonmap: 'UserRoleName', width: 150, editable: true },
                                  { name: 'UserRoleDescription', index: 'UserRoleDescription', jsonmap: 'UserRoleDescription', formatter: 'textarea', width: 150, editable: true },
                                  { name: 'UserRoleStatus', index: 'UserRoleStatus', jsonmap: 'UserRoleStatus', formatter: 'checkbox', align: 'center', width: 150, editable: true }
                              ],
                              ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
                              contentType: "application/json; charset=utf-8",
                              serializeGridData: function (postData) {
                                  // extend the parameter which will be send to the server
                                  //postData.formVars = $("#Content2").serializeArray();
                                  // serialize the parameters as JSON string
                                  return JSON.stringify(postData);
                              },
                              caption: "User Roles List",
                              viewrecords: true,
                              gridview: true,
                              autoencode: true,
                              loadonce: true,
                              loadError: function (xhr, st, err) {
                                  alert("Type: " + st + "; Response: " + xhr.status + " " + xhr.statusText + err);
                                  //jQuery("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
                              },
                              jsonReader: {
                                  root: function (obj) { return obj.d; }, //array containing actual data
                                  //page: function (obj) { return 1; },
                                  //total: function (obj) { return obj.d.length/25; },
                                  //records: function (obj) { return obj.d.length; }, //total number of records
                                  repeatitems: false,
                                  id: 'UserRoleId',
                                  cell: '',
                              },
                              width: 780,
                              height: 250,
                              rowNum: 25,
                              rowList: [25, 50, 100],
                              pager: "#jqGridPager",
  
                          }).navGrid('#jqGridPager', { edit: true, add: true, del: true, excel: true, addtext: 'ADD' }, // Edit options 
                          {
                              savekey: [true, 13],
                              reloadAfterSubmit: true,
                              jqModal: false,
                              closeOnEscape: true,
                              closeAfterEdit: true,
                              url: '../BibLOSApp/UserRoles.aspx/UpdateUserRole',
                              datatype: 'json',
                              mtype:'POST',
                              ajaxEditOptions: { contentType: 'application/json; charset=utf-8' },
                              contentType: "application/json; charset=utf-8",
  
                              serializeEditData: function (postData) {
                                  // extend the parameter which will be send to the server
                                  //postData.formVars = $("#Content2").serializeArray();
                                  // serialize the parameters as JSON string
                                  alert(JSON.stringify(postData));
  
                                  return JSON.stringify(postData);
  
                              },
  
                          });
  
                      });
  
                  &lt;/script&gt;
  
  
  code behind
  
  [WebMethod]
          [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
          public static string UpdateUserRole()
          {
              string s = "test";
              return s;
          }
  </code></pre>
  
  <p>I am able to load the grid but the issue is while editing the data. I am able to just invoke the method when i click on submit while editing. could some help me on how to get the json data from the jqgrid to the webmethod.</p>