日期:2014-05-17  浏览次数:20440 次

webdiyer请进.有关MVC4使用MVCPAGER问题。
mvc4提示“指定的数组必须具有相同的维数”
错误文件:PagerBuilder.cs
错误节点:
if (String.IsNullOrEmpty(actionName))
            {
                if (ajax != null)
                    actionName = (string)ajax.ViewContext.RouteData.Values["action"];
                else
                    actionName = (string)html.ViewContext.RouteData.Values["action"];
            }

其中定在:
actionName = (string)html.ViewContext.RouteData.Values["action"];

测试项目已经发往您的邮箱webdiyer at gmail.com

望指点一下,麻烦您了,杨老师

------解决方案--------------------
这个问题已经有不少网友说过,也给我发了测试的例子,但我没找出到底是什么原因导致的,很有可能是mvc4的兼容问题,解决办法是将MvcPager源码在VS打开后,删除对System.Web.Mvc.dll 3.0版的引用,添加4.0版的引用后重新编译即可。