我在 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 - JqGrid 在 ASP.NET MVC2 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2617177/