Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using JQGrid in my application, and require add/edit/delete option to point to defined controller methods.I did some research and written the following code but it is not hitting the controller. Paging, sorting, searching working properly.


XML
<table id="jQGridDemo">
</table>
<div id="pager">
</div>


......

C#
$(document).ready(function () {
    jQuery("#jQGridDemo").jqGrid({


............

pager: "#pager",

});

C#
jQuery("#jQGridDemo").jqGrid('navGrid', '#pager', { add: true, edit: true, del: true, search: false, refresh: false }, { url: "/controller/method" }, {}, {}, {}, {});
         jQuery("#jQGridDemo").jqGrid('filterToolbar', { searchOnEnter: false });


});

I have also used different syntax for URL:
{ url: '@Url.Action("controller/method")'}

Can anyone tell me what is the correction required in the syntax? Thanks in advance.
Posted
Updated 6-Nov-13 19:57pm
v2

1 solution

there is url: that might be not convert the server side code....
Just use the ~/controllername/ActionName in place of
@Url.Action("controller/method")


Try one it may be helpful
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900