0

我正在将 MVC3 应用程序更改为 MVC4(所有正确的更改都已在 web.config 中完成)。应用程序加载正常,某些页面也是如此,但之前在 MVC3 中工作的某些页面抛出了与以下相同的错误:我已正确完成引用,并且在转换过程中没有更改任何代码

谁能告诉我这个错误的解决方案

Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'

当我在这样的 cshtml 中调用此方法时会发生这种情况

 @{ Html.RenderAction("GetTestItem", "TestItemsInCart", Model.TestItemsList);}

GetTestItem 方法是

[HttpGet]
        public ActionResult GetTestItem(TestItemsList test)
        {

            TestViewModel xyzViewModel = new TestViewModel ();
            return PartialView("_TestXyz", xyzViewModel );
        }

该方法在控制器中被调用,它仅在 cshtml 中将结果返回到视图中,我得到了声明的异常。

这以前在 mvc3 中工作 谢谢

4

2 回答 2

0

Here are the steps that you need to follow to manually upgrade an existing ASP.NET MVC 3 application to MVC 4: http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806

Also the error message that you are getting indicates that you have some missing closing braces in your Razor view. Make sure you have fixed it or show your Razor view if you expect other people be able to help you.

于 2012-12-26T13:14:11.927 回答
0

Check for opened brackets. Any opened bracket { needs to be closed with another bracket }. Check for naming of the variables.

于 2012-12-26T13:15:48.767 回答