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

  • Home
  • SEARCH
  • 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 6901065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:37:35+00:00 2026-05-27T07:37:35+00:00

Do PartialViews used in conjunction with $(‘#container’).load() html updates work with webgrids? I have

  • 0

Do PartialViews used in conjunction with $(‘#container’).load() html updates work with webgrids? I have used PartialViews to make updates to a regular html table but I can’t get the following to work using a webgrid that is wrapped in a div.

Everything comes back from my action controller that returns a PartialView in the javascript() function in the form of an updated built using the webgrid but the div is not updating the webgrid table contents when I call load() within the javascript function.

Here are some code snippets:

Main Index View (this is being populated from an Index action with all rows in my model):
(Page contains a webgrid and a dropdownlist)

@model IEnumerable<Models.Person>
@Html.ListBox("CStatus", null, new { style = "width:104px;" })   @*Multiselect that invokes the filter*@
  <div id="gridview" class="gen">@Html.Partial("_Persons", Model)</div>  @*Main Webgrid

    <script type="text/javascript">
        $("select").multiselect({
            click: function (event, ui) {
                alert('hello');
                $.get('@Url.Action("Filter")', function (data) {
                    window.alert('New filtered data coming from action!');
                    window.alert(data);  @*This comes back with new <table>... html data*@
                    $('#gridview').load('@Url.Action("Filter")', data);  @*not updating table data*@                               
                });
            }
        });
</script>

Rendered Webgrid:

<div id="gridview">
    <table class="webgrid"><thead><tr class="head"><th scope="col">  <MORE COLUMN DEFS...then just basic html tr/td tags....
</table>
</div>

Controller Action:

   public ActionResult Filter()
    {
        IList<Person> cs = cs = db.Persons.OrderByDescending(x => x.Id).ToList();
        return PartialView("_Persons", cs);
    }

_Persons.cshtml Shared/Partial Template to dispaly webgrid :

@model IEnumerable<Models.Person>
@{           
    var grid = new WebGrid(source: Model,   
        rowsPerPage: 50);

}

    @grid.GetHtml(
        tableStyle: "webgrid",
        headerStyle: "head",
        alternatingRowStyle: "alt",
        columns: grid.Columns(
        grid.Column("PersonId", "Id"),
        grid.Column("PersonName", "Name")
   )
  • 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-27T07:37:36+00:00Added an answer on May 27, 2026 at 7:37 am

    Visit this below links:-

    http://geekswithblogs.net/jdothoffman/archive/2011/04/01/mvc-3-updating-the-content-of-a-webgrid-revisited.aspx

    http://evolpin.wordpress.com/2011/04/26/asp-net-mvc-partial-view-and-ajax-real-world-example/

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

Sidebar

Related Questions

I have a partial view which renders a table. On page load, I am
In Asp.Net 1.0/2.0/3.0 (non-MVC) I used to be able to change HTML markup whilst
I used mvc 4.0 to develop my web application, I have created a pager
I have this : HTML : form + jquery Controller I post the form
At work I have been tasked with adding additional functionality to an existing MVC
I have seen many questions raised around PartialViews and Javascript: the problem is a
I have created VIEWS and PartialVIEWS, but so far, i have seen that VIEWS,
I understand that partial views are used to render parts of a view. But
I'm using MVC2 with VS2010 I have a view that has two partial views
I tried the MVCScriptManager from CodePlex and it seems to work well until you

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.