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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:42:21+00:00 2026-05-12T13:42:21+00:00

I’ve been evaluating a number of JQuery table plugins to handle my paging and

  • 0

I’ve been evaluating a number of JQuery table plugins to handle my paging and sorting needs. I am looking for something that allows be to page and sort my tables with an AJAX call.

The problem that I am having is that all the plugins that I have found expect the Ajax call to return JSON. This is perfect for simple scenarios but falls down when I want to apply complex formatting to my tables, as soon as I want my table to include links or icons or other complex rendering I am faced with reproducing server side code that generates these links or chooses the appropriate icon as client side code to do the same thing.

What I would like to do is return the new table data as an html table and have the plugin replace the existing table with the returned table (either directly or by copying cells, the specifics are not important). Are there any reccomendations for the best way to do this?

  • 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-12T13:42:22+00:00Added an answer on May 12, 2026 at 1:42 pm

    I think your best option will be to create a controller action that returns a partial view which contains your table. The partial view can contain any JavaScript based table/grid you want. This solution has no dependency at all on any specific grid/table implementation.

    For instance, let’s say you have a strongly typed partial view of type ViewUserControl<IEnumerable<Foo>> named FooList.ascx

    You would then define some action in your controller that rendered this partial

    // For paging support, you would probably need to modify this action to accept
    // a parameter that could be used to tell which records to retrieve.
    // This would also require the appropriate route. However, this is beyond
    // the scope of this example.
    public PartialViewResult List()
    {
      // get the collection of stuff that you want to display
      var items = this.itemRepository.GetItems();
    
      // return the partial
      return PartialView("FooList", items);
    }
    

    In your view where this partial is going to be used, you will want to have something like the following…

    <!-- this <div> will contain the partial, which we will be able to update via AJAX -->
    <div id="FooList">
        <%-- this assumes a collection of "items" is available in Model.Items --%>
        <% Html.RenderPartial("FooList", Model.Items); %>
    </div>
    
    <!-- use an AJAX ActionLink to update the table -->
    <%=
        Ajax.ActionLink
        (
            "Click Me to Update the Table using AJAX!",
            "List",
            new AjaxOptions()
            {
                HttpMethod = "GET",
                LoadingElementId = "FooList"
            }
        )
    %>
    

    All we’re doing here is using the ASP.NET MVC AJAX Helper to create a link that will generate an AJAX GET request to the List action in your controller. Also, by defining the LoadingElementId property in the AjaxOptions object, we have told the helper that we want to replace the inner contents of <div id=”FooList”> with the results of the AJAX request.

    When a user clicks that link, an AJAX request will cause your List action to be invoked. Your list action simply returns the rendered contents of the partial view FooList.ascx. The existing contents of the div with id=”FooList” will be replaced by the contents that were retrieved from the AJAX request. In the above example, the controller action will always select the same data, which is not really what you want. In a real scenario, you would have to modify the controller action to retrieve the appropriate data for your partial view. I couldn’t suggest an effective way for you to handle that without knowing the details for your implementation.

    If you don’t want to use a link, then just look at the HTML and JavaScript that is generated by the Ajax.ActionLink helper and adapt it to your own needs. For instance, build your own custom helper, or just manually write out the JavaScript.

    Lastly, don’t forget to include the MVC AJAX JavaScript source files. I recommend including them in your master page. For example:

    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.