jqueryasp.netasp.net-mvcgridareas

Help with jQuery Grid in an ASP.Net MVC 2 RC with areas


I've followed Phil Haack's demo of jQuery Grid successfully in an mvc 2 rc project without areas. Now I'm trying to implement the same code in an areas project but the data is not being passed to the grid.

The jquery grid url property from the demo appears to be in the format of:

url:'/{controller}/{method}/'

I'm attempting to include the area in the url property without success:

url:'/{area}/{controller}/{method}/'

How do I retrieve the data from a method in controller using areas?


Solution

  • The problem wasn't with the url property but my failure to change the controller name property in the url to match the controller name in the area.

    I did discover that the json security in MVC 2 doesn't allow json get requests unless explicitly allowed. This can be set in the return statement of the grid action method:

    return Json(jsonData, JsonRequestBehavior.AllowGet);