Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6560029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:24:27+00:00 2026-05-25T13:24:27+00:00

I seem to have a problem with the setup of my web service when

  • 0

I seem to have a problem with the setup of my web service when trying to save row data from my jqGrid. The data comes back fine; the grid loads the data fine and the edit box displays fine when I click the pencil. I’ve checked the Request body using IE Developer tools and it shows data like: Step_Number=1&oper=edit&id=1 I know there is something missing in the way I’ve got this method setup and the way it’s called but I can’t for the life of me find the answers I’m looking for.

What do I need to format the data into JSON and send it and what do I have to have on my .Net method to accept the data?

Thank you for any help you can provide.

[WebInvoke(Method = "POST", UriTemplate = "/Save/JSA", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
public string UpdateRecord()
{}

**Update** This is the one that works
[WebInvoke(Method = "POST", UriTemplate = "/Save/JSA", BodyStyle = WebMessageBodyStyle.Wrapped,  RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
public string UpdateJSA(string Step_Number, string Step_Description, string oper, string id)
{}

When I use the above, the function works but I get no data. The second I put a parameter, my code just seems to break. Here is my jqGrid code that I’m using:

$.getJSON('FileServices/Get/JSA/' + id, function (data) {
$("#list").jqGrid({
    url: 'FileServices/GetList/JSA',
    cellEdit: true,
    editurl: 'FileServices/Save/JSA',
    //serializeRowData: function (data) { return JSON.stringify(data); },
    datatype: 'local',
    gridComplete: function () {
            $("#list").jqGrid('setGridParam', {}).trigger("reloadGrid");
    },
    onSelectRow: function (rowid, status) {
    },
    loadComplete: function (data) {
            var det = $("#details");
            $("#list").setGridWidth(det.width() - 18, true);
    },
    colNames: ['Id', 'Step Number', 'Step Description'],
    colModel: [
      { name: 'Id', index: 'Id', width: 30, sortable: false, hidden: true },
      { name: 'Step_Number', editable: true,  index: 'Step_Number', align: 'center', width: 50,  fixed: true, resizable: false, sortable: false, title: false, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal; vertical-align: top;' } },
      { name: 'Step_Description', index: 'Step_Description', sortable: false, width: 400, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal; vertical-align: top;' } }
    ],
    pager: '#pager',
    rowNum: 5,
    rowList: [5, 10, 15, 20, 25, 30, 50],
    sortname: 'Id',
    height: 'auto',
    rownumbers: true,
    autowidth: true,
    forceFit: true,
    shrinkToFit: true,
    sortorder: 'asc',
    viewrecords: true,
    gridview: true,
    hidegrid: false,
    caption: ''
});

$.extend($.jgrid.edit, {
    ajaxEditOptions: { contentType: "application/json" },
    recreateForm: true,
    serializeEditData: function (postData) {
        return JSON.stringify(postData);
    }
});

var thegrid = $("#list");

for (var i = 0; i < data.details.length; i++) {
    thegrid.addRowData(i + 1, data.details[i]);
}

thegrid.navGrid("#pager");
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:24:28+00:00Added an answer on May 25, 2026 at 1:24 pm

    You posted not all code which is required. You wrote “when I click the pencil” so I suppose that you use navGrid somewhere, but how and with which parameters?… In any way you set jQuery.jgrid.edit in the wrong way. The code should looks about the following:

    $.extend($.jgrid.edit, {
        ajaxEditOptions: { contentType: "application/json" },
        recreateForm: true,
        serializeEditData: function (postData) {
            return JSON.stringify(postData);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query about the following web.config setup and Elmah. The problem is
I seem to have a problem with getting MVC to fill in my custom
I seem to have a problem understanding how to conditionally test a boolean value
I seem to have a tricky problem since the latest ADT update to release
I have a problem which I cant seem to find answer to through searches
I have a problem which i can't seem to find the solution to. I
I seem to have the exact opposite problem than this question on stopping dock
I have a strange problem that I can't seem to solve. I've quite a
I have a pretty basic problem but I can't seem to figure it out...
I have a very simple C# DataTable problem that I cannot seem to wrap

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.