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();     } 

enter image description here

after occur edit function : enter image description here

you can clear markup partial view using empty():

$('#edittestsection').empty();

which include part of submit function.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -