I understand how to execute the render partial but how to refresh a webgrid with the new data
Razor syntax please.
$.get( '@Url.Action("details","user", new { id = Model.ID } )',
function(data) { $('#detailsDiv').replaceWith(data); });
where the user controller has an action named details that does:
public ActionResult Details( int id ) {
var model = ...get user from db using id...
return Partial( "UserDetails", model ); }
End result should be something like this
Like var grid = new WebGrid(source:Model.UserDetails,….
in your partialView Change your grid declaration to something like :
ensure that your .GetHtml method has :
//.. rest of the options here
)
and add the below to your Index.cshtml
remember to put
in your parial to get only the webgrid (without the whole template)