javascript - How to add or remove partial view Asp.net mvc with jquery? -
i have grid (kendo grid), when occur edit function record of grid,i call partial view use of jquery.now want after submit partial view, remove main view. function render partial view :
function showeditrecord(e) { var dataitem = this.dataitem($(e.currenttarget).closest("tr")); $.ajax( { url: '/home/testedit/'+dataitem.id.tostring(), contenttype: 'application/html; charset=utf-8', type: 'get', datatype: 'html' }) .success(function(result) { $('#edittestsection').html(result); }) my code of controller :
public actionresult testedit(int64 id) { var modelitem=gett().where(a => a.id == id).firstordefault(); return view (modelitem); } [httppost] public actionresult testedit(models.test test) { base.update(test); return view(); } 
after occur edit function : 
you can clear markup partial view using empty():
$('#edittestsection').empty();
which include part of submit function.
Comments
Post a Comment