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 7627677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:29:30+00:00 2026-05-31T05:29:30+00:00

Please i need some help in how to bind jqGrid with asmx webservice C#

  • 0

Please i need some help in how to bind jqGrid with asmx webservice C# , i found some topics in how to convert asmx webservice to JSON but it’s not clear with me

Regards

  • 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-31T05:29:31+00:00Added an answer on May 31, 2026 at 5:29 am

    First of all you should define WebMethod which will provide the data for the jqGrid. If you plan to implement server side sorting and paging the webmethod should have at least the following parameters

    public JqGridData TestMethod (int page, int rows, string sidx, string sord)
    

    where JqGridData class will be defined for example like

    public class TableRow {
        public int id { get; set; }
        public List<string> cell { get; set; }
    }
    public class JqGridData {
        public int total { get; set; }
        public int page { get; set; }
        public int records { get; set; }
        public List<TableRow> rows { get; set; }
    }
    

    There are other different options how one can fill the grid, but it’s first important to understand at least one way.

    It’s important, that to return JSON data from the web method you don’t need to convert the returned data manually to JSON. You need just return the object with the data and the ASMX web service will serialize the object itself to XML or JSON based on the headers of the HTTP request.

    It the request to the server will have application/json; charset=utf-8 or application/json in the Content-Type part of the HTTP header, the returned data will be JSON and will be

    {
        "d": {
            "page": 1,
            "total": 4,
            "records": 4,
            "rows": [
                ...
            ]
        }
    }
    

    On the client side you should use

    $("#list").jqGrid({
        url: 'MyTestWS.asmx/TestMethod',
        datatype: 'json',
        mtype: 'POST',
        ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
        serializeGridData: function (postData) {
            return JSON.stringify(postData);
        },
        jsonReader: {
            root: "d.rows",
            page: "d.page",
            total: "d.total",
            records: "d.records"
        }
        gridview: true,
        ...
    }
    

    See here for a code example.

    UPDATED: Here and here you can download Visual Studio demo projects. See the answer for more links to other demo projects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need some help writing a for-loop please but i can't get it. i
I need some help! Please. I am trying to develop a very very simple
I need some help with a LINQ query in VB.Net, please. I have this
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
I need some with help with PowerShell, please. It should be pretty easy: I
please i need you help with my script.. I'm trying to echo some content
I need some help with this please I can't get a handle on it.
Having some issue with Threadpooling here that I need some help with please. I
Need some help with regex matching please. I'm trying to match a double quoted
I am getting a little confused and need some help please. Take these two

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.