简体   繁体   中英

How do I use ASP.NET pages in an ASP.NET MVC application?

I have a site written in C# using the ASP.NET MVC 2 frameworkthat unfortunately requires a few pages to work on Webforms (for a ReportViewer Control that needs Viewstate.

I've created a folder called Reports , converted it to a Web Application and added a page to the folder called ReportViewer.aspx (the system correctly added aspx.cs file and aspx.designer files).

I also created a class called BasePage.cs which inherits from System.Web.UI.Page and made my ReportViewer.aspx.cs inherit it.

When I try to browse this page, I get the following error:

Parser Error Message: Could not load type AzureWatch.ControlPanel.Web.Reports.ReportViewer .

Source Error:

Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.aspx.cs" Inherits="AzureWatch.ControlPanel.Web.Reports.ReportViewer"

How do I get ASP.NET aspx pages to show up in an ASP.NET MVC site correctly?

您可以通过将.aspx页添加到您的MVC应用程序中来使用它们-无论如何,MVC是基于ASP.NET的框架,因此除了您自己的罪恶感外,没有什么可以阻止您添加.aspx页了:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM