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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:47:43+00:00 2026-06-06T23:47:43+00:00

I have a WebGrid bound to a Plain Class Object. Nothing Fancy. The Grid

  • 0

I have a WebGrid bound to a Plain Class Object. Nothing Fancy. The Grid features some paging and is used to display a list of users. The Last column of the Grid is an Ajax Action Link which fires a Pop Up DIV with some Edit Controls. On completion of this Edit the OnSuccess Event fires and closes the DIV. This is where I would like to now refresh the grid without losing the current page/search/filter applied. One way that comes to mind is to somehow grab the WebGrids Url and then refreshing it with JQuery, however.. I cant find a way to retrieve the current url and parameters? Anyone tried this before?

UPDATE: Thanks to the answers this is what I have resorted to now:)

The ActionResult called by the ajax edit

[HttpPost]
public ActionResult EditUserDetails(User model)
{
    if (ModelState.IsValid)
    {
        // for the sake of brevity.

        // do your edit logic here and then on success you return:

        return Json(new { state = "success", id = "1", name = "John", surname = "Doe", etc = "blah" });
    }
    else
    {
        return Json(new { state = "failed", message="some error text here maybe?" });
    }
}

Then on the edit click I set the class of the row to be .editRowSelected. (i will be changing this to an id rather)

Then onSuccess of the Ajax Update Call:

function onSuccess(ajaxContext) {
    var result = eval(ajaxContext);
    if (result.state == "Success") {

        var row = $('.busyEditRow');
        row.html(content);

        $('.busyEditRow').removeClass('busyEditRow');
    }
    else {
        // Display some error stuffs here with the message - result.message
    }
}

This updates the grid row with the new data:)

  • 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-06-06T23:47:45+00:00Added an answer on June 6, 2026 at 11:47 pm

    Having just edited one record, rather than refreshing the entire grid and having to then post back the filters applied, current page, etc, I would have a function in my controller that returns a partial view containing data for a single user.

    You could call this via AJAX after the DIV closes, and use jQuery to replace the row in the grid with the HTML returned from the function.

    As long as each row in the grid is identifiable by id, it should be simple enough to find the relevant row and replace it.

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

Sidebar

Related Questions

I Have used WebGrid to take benefit of inbuilt sorting and paging in MVC
I am using a webgrid to display some dynamic data. I have recently refactored
have written this little class, which generates a UUID every time an object of
I have a WebHelpers WebGrid in MVC 3.0 and would like to custom display
I have some short questions about the Webgrid. How can I put in a
I have an asp.net mvc application and I'm using Webgrid to list customers. I
I'm having an issue with WebGrid paging; but first, here's some controller pseudo code:
I'm new to MVC so have some conceptual issues. I have a WebGrid that
Does anyone have a working sample of json paging for mvc3 webgrid? I've been
I have a Car class that I'm trying to display in an MVC 3

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.