I have a page (aka PAGE1) that has a complex grid (like jqgrid) that you can filter/sort/page through results.
When you click on a row on the grid, I would like to load/get a form that I have in a different view (aka PAGE2) and load it into a DIV container on PAGE1. I want to do this instead of redirecting to PAGE2 because i want to keep PAGE1’s state (ie: sorted & paged results).
PAGE2 has a model that loads the page, allows user to edit the fields and submit the changes.
I really like MVC’s out-of-the-box functionality that validates the fields and highlights the field that has a problem (amongst other things), but MVC (out of the box) does a postback. This reloads the whole page, so now the broswer is on PAGE2 and PAGE1 is gone (along with it’s state).
Is there a way to load PAGE2 in such a way (without iframes!) that a postback would only refresh the DIV on PAGE1 it’s loaded in?
Also, when I .get() PAGE2 into a DIV on PAGE1 – if PAGE2 has any plugins in it, it seems to break PAGE1 when i close PAGE2….not sure if the two are related.
I hope this makes sense – thanks in advance SO!
When I need to do something like this, I do a
Html.RenderPartialon the page using anAjax.BeginForm– the Razor helper for ajax handles a lot, but since you’re getting into the weeds, I’m not sure why you couldn’t just set up the ajax calls (onSuccess, onFailure)yourself.