升级MVC 2 MVC,享有3个问题 [英] Upgrade MVC 2 to MVC 3 issues with views

查看:115
本文介绍了升级MVC 2 MVC,享有3个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图升级现有的ASP.net MVC 2的Web应用程序MVC 3,所以我可以用善良是剃刀视图引擎和其他的改进。

I'm attempting to upgrade my existing ASP.net MVC 2 web application to MVC 3 so I can use the goodness that is the Razor Viewengine and other said improvements.

利用转换到我的应用程序转换到MVC2 MVC3我有我的强类型的意见问题之后。这里作为一个例子,我们有一个强类型的类配置文件的视图用户控件

After using the converter to convert my app from mvc2 to mvc3 I'm having issues with my strongly typed views. As an example here we have a view user control that is strongly typed to the class Profile

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Profile>" %>

在编译过程中我收到

During compilation I'm getting

Compiler Error Message: CS1061: 'object' does not contain a definition for 'folio' and no extension method 'folio' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

对应于这条线在我看来


which corresponds to this line in my view

因此​​,它就像意见不再接受一个类型。这是发生瓦特/用户控件以及完整的意见。

So it's like the views are no longer accepting a type. This is happening w/ user controls as well as full on views.

我检查web.config文件都和看法/ web.config中和似乎都被引用System.Web.Mvc版本3.0.0.0

I've checked both web.config and views/web.config and both seem to be referencing System.Web.Mvc version 3.0.0.0

任何帮助将是AP preciated!

Any help would be appreciated!

请参阅下面的web.configs的屏幕捕获

See below for screen captures of web.configs

推荐答案

这是MVC 3 preVIEW 1个bug,并会在未来的版本中得到解决。在此期间,你可以重新安排你的页面,这样的&lt;%@控制%>指令是最后一个文件中,并且应该为你的问题。

This is a bug in MVC 3 Preview 1, and will be addressed in the next release. In the interim, you can rearrange your pages so that the <%@ Control %> directive is the last one in the file and that should the issue for you.

这篇关于升级MVC 2 MVC,享有3个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆