views:

819

answers:

3

Hi all,

I have a problem with jqGrid and ASP.NET MVC framework. Namely, jqGrid is working fine, until the point when I have in address bar URL like this:

http://[domain]/Controller/Action

It gives me JS error: "Object doesn't support this property or method".

When URL is like this:

http://[domain]/Controller

everything is working fine. Properties for jqGrid are:

url: '/Controller',
datatype: 'json',
mtype: 'POST'

etc.

Has anyone else encountered with this problem?

Thanks in advance, Dejan

A: 

If you're posting your action method needs this decoration:

[AcceptVerbs(HttpVerbs.Post)]

Hi,Yes I have this decoration. "Post" is working, the problem is when URL is like http://[domain]/Controller/Action. Without Action at the end of URL, jqgrid is working fine.
Dejan
A: 

The problem was inside the file "jquery.jsGrid.js". The path in variable "pathtojsfiles" was missing one backslash at the beginning.

Dejan
A: 

a great post on mvc and Jqgrid with a sample.

http://arahuman.blogspot.com/2009/06/jqgrid-using-mvc-json-and-datatable.html

Thanks, I'll check it.
Dejan