asp.net - JqG​​rid 在 ASP.NET MVC2 中不起作用

标签 asp.net json asp.net-mvc-2 jqgrid

我在 ASP.NET MVC1 中有一个使用 VB.NET Controller 和 JqGrid 的项目。它在 MVC1 下工作正常。将项目迁移到 ASP.NET MVC2 后,网格不再填充。好像MVC2中对返回的Jsonresult有一些新的限制。如何在 VB.NET 中解决这个问题。填充 jqgrid 的 Controller 函数是这样的:

Function GetGridRecordset(ByVal qry As String) As JsonResult
  Dim result = New JsonResult()
  ...
  ...
  Return result
End Function

有没有人有解决办法?

最佳答案

在 Asp.net MVC 2 中,JsonResult 仅响应 http Post。

http://www.asp.net/learn/whitepapers/what-is-new-in-aspnet-mvc/#_TOC5

这是一篇关于为什么 Get 不支持 Json 的帖子

http://haacked.com/archive/2009/04/02/anatomy-of-csrf-attack.aspx

关于asp.net - JqG​​rid 在 ASP.NET MVC2 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2617177/

相关文章:

asp.net - 在 MVC 2 中使用 CSS 显示图像

asp.net - 回发时丢失文本框值

c# - JSON 计数只返回 1 而不是 2

asp.net - 使用 JavaScript 显示页面加载进度

json - 不明确的使用 go 'subscript'

javascript - 无法使用 $http 读取 json 文件

javascript - KnockoutJS 绑定(bind)问题 - 无法读取属性

javascript - ASP.NET MVC 编辑器用于自定义 javascript

c# - 如何在 asp.net session 变量过期之前执行服务器端代码?

asp.net - 测试以确定您的开发环境?