带有MVC的ASP.NET Webform

时间:2015-11-09 17:32:46

标签: c# asp.net asp.net-mvc webforms

我有一个使用ASP.NET Web表单技术在Visual Studio 2008上创建的应用程序(3.5)。该应用程序已经逐渐增长,并且仍在使用相同的技术。该应用程序具有多个子应用程序,代表应用程序的多个区域。这些子应用程序是在example的帮助下创建的。

So just to give you a large picture of my entire application, it's:

SolutionFolder  
--- Application1
------- Application1_WebForm 
------- Application1_Code 
--- Application2
------- Application2_WebForm 
------- Application2_Code 
--- RootApplication  
------- RootApplication_WebForm 
------- RootApplication_Code
  

MVC应用程序

--- Application3
------- Application3_MVC
------- Application3_Code

RootApplication包含应用程序的登录页面,还包含所有共享组件包括母版页(包含导航到其他应用程序文件夹),样式表,脚本文件等。所有这些项目都是用webform技术构建的。

现在,我想再添加一个应用程序,比如我想用MVC创建Application3

我已经在MVC中添加了一个新项目,并转换了MVC应用程序,就像我以前的Webform应用程序一样(如上例所示)。

当我尝试从Application3的着陆页访问我的RootApplication时,我收到了以下错误:

Server Error in '/ver3' Application.
The view 'Index' or its master could not be found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The view 'Index' or its master could not be found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx

Source Error:


Line 17:             HttpContext.Current.RewritePath(Request.ApplicationPath, false);
Line 18:             IHttpHandler httpHandler = new MvcHttpHandler();
Line 19:             httpHandler.ProcessRequest(HttpContext.Current);
Line 20:             HttpContext.Current.RewritePath(originalPath, false);
Line 21:         }

任何帮助都将受到高度赞赏。

0 个答案:

没有答案
相关问题