问题混合的WebForms到ASP.NET MVC应用程序 [英] Problem mixing webforms into ASP.NET MVC application

查看:119
本文介绍了问题混合的WebForms到ASP.NET MVC应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图与以现有的ASP.NET Web表单应用程序并将其转换为混合动力,这样展望未来,我们可以做的ASP.NET MVC的想法。

I've been trying with the idea of taking an existing ASP.NET Webforms application and converting it to a hybrid so that going forward, we can do ASP.NET MVC.

在为了做到这一点,我创建了一个ASP.NET MVC应用程序,并开始复制一些从包含web表单的ASP.NET web表单的项目文件夹。我有一个问题,构建生成的项目越来越数百这种形式的编译错误的:

In order to do this, I created an ASP.NET MVC application and started copying some of the folders from the ASP.NET webforms projects that contain webforms. I'm having a problem building the resulting project getting hundreds of compile errors of this form:

Error   1951    'Documents_Admin_DocPushByTag' does not contain a definition for
'CtlCategoryList' and no extension method 'CtlCategoryList' accepting a first argument 
of type 'Documents_Admin_DocPushByTag' could be found (are you missing a using directive
or an assembly reference?)

每个这些错误信息是指服务器控件在我的标记。这是因为,如果加价是没有得到解析?当我编辑文件和类型的背后的code之一这一点。即可看到智能感知识别,这些控件不会出现。该事件处理程序做(但必须是因为它们在文件后面code定义)。至于我可以告诉大家,在 codeFILE 继承页属性是正确的(不变从ASP.NET项目从那里他们来到)。我大惑不解,是什么原因造成了这个问题。有任何想法吗? TIA。

Each of these error messages refer to server controls in my markup. It's as if the mark-up is not getting parsed? When I edit one of the code behind files and type this. to see what intellisense recognizes, these controls don't appear. The event handlers do (but that must be because they are defined in the code behind file). As far as I can tell, the CodeFile and Inherits Page attributes are correct (and unchanged from the ASP.NET project from whence they came). I'm mystified what is causing this problem. Any ideas? TIA.

推荐答案

看一下Scott Hanselman的是如何做的:

<一href=\"http://www.hanselman.com/blog/PlugInHybridsASPNETWebFormsAndASPMVCAndASPNETDynamicDataSideBySide.aspx\" rel=\"nofollow\">http://www.hanselman.com/blog/PlugInHybridsASPNETWebFormsAndASPMVCAndASPNETDynamicDataSideBySide.aspx

check out how scott hanselman does it:
http://www.hanselman.com/blog/PlugInHybridsASPNETWebFormsAndASPMVCAndASPNETDynamicDataSideBySide.aspx

basicallly,你会使用ignoreroute排除所有你的Web表单的被路由到一个MVC处理程序

basicallly, you'd use ignoreroute to exclude all of your webforms from being routed to an mvc handler

这篇关于问题混合的WebForms到ASP.NET MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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