开发者

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

I've followed Phil Haack's d开发者_JAVA百科emo 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?


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜