asp.net mvc - Issue with paging when deleting object when using DeletObject (Entity Framework) -
i'm having issue paging when delete object using deleteobject method (entity framework). deletion works fine, supposed to, page number updated next page. mean, if i'm deleting record on page 3 of search results, after deletion completed, page number updated "page 4", though search results still correspond page 3!
i have checked think of, can't figure out wrong. has had problem before? (i'm pretty new mvc, razor, etc).
thank you!
thanks reply, gert arnold , moeri; posted in hurry going meeting , didn't add enough details.
as went grab code post here, found solution:
function deleterecord(subscriptionid){ var url = "@url.content("~")pubsub/deletesubscriber/" + subscriptionid; if(confirm("are sure want delete record?")){ $.get(url, function (data) { if(data=="true") { $("#subscriptioncontainer"+subscriptionid).show(); $("#subscription"+subscriptionid).html("<b><i>delete successful! refreshing list please wait........</i></b>"); window.settimeout(function () { getpage($("#pagenumber").val() - 1); //adding "- 1" solved issue }, 2000); } }); } }
to fix code did replacing getpage($("#pagenumber").val(), getpage($("#pagenumber").val() - 1);
Comments
Post a Comment