views:

170

answers:

1

I've setup a jqGrid like this

$('#gridTable').jqGrid({
  url: '/GridData/',
...

Now if I navigate to a url such as "/Controller/id/" then the grid will send a GET to "/GridData/" instead of "/Controller/id/GridData/".

Can I make the GET relative so that I can pick the id up on the server side or do I have to manually pass the id as a parmater using javascript on the client?

+2  A: 
url: '<%= Url.Action("ActionName", "ControllerName", new { id = whateverYouNeed } %>',

Put your action and controller instead of "ActionName" and "ControllerName"

uvita
url: '<%= Request.RawUrl %>/GridData/' also seems to do the trick
Chris Herring