jqGrid和ASP.NET MVC URL发布问题

时间:2022-11-30 16:41:43

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:

我有jqGrid和ASP.NET MVC框架的问题。也就是说,jqGrid工作正常,直到我在地址栏URL中这样:

http://[domain]/Controller/Action

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

它给了我JS错误:“对象不支持此属性或方法”。

When URL is like this:

当URL是这样的:

http://[domain]/Controller

everything is working fine. Properties for jqGrid are:

一切都很好。 jqGrid的属性是:

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

etc.

Has anyone else encountered with this problem?

还有其他人遇到过这个问题吗?

Thanks in advance, Dejan

提前谢谢,德扬

3 个解决方案

#1


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

如果你发布你的动作方法需要这个装饰:

[AcceptVerbs(HttpVerbs.Post)]

#2


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

问题出在文件“jquery.jsGrid.js”中。变量“pathtojsfiles”中的路径在开头缺少一个反斜杠。

#3


a great post on mvc and Jqgrid with a sample.

关于mvc和Jqgrid的一篇文章,有一个样本。

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

#1


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

如果你发布你的动作方法需要这个装饰:

[AcceptVerbs(HttpVerbs.Post)]

#2


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

问题出在文件“jquery.jsGrid.js”中。变量“pathtojsfiles”中的路径在开头缺少一个反斜杠。

#3


a great post on mvc and Jqgrid with a sample.

关于mvc和Jqgrid的一篇文章,有一个样本。

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