简体   繁体   中英

Using UserControls within a ASPX View in ASP.NET MVC 4

I'm in the process of migrating a traditional ASP.NET Web Form app to ASP.NET MVC 4. I've been migrating this project over by adding new Views to my ASP.NET MVC 4 project that use the ASPX view engine. I then take the code-behind content and put it in a <script language="CS" runat="server"> within the view file.

My Web Forms project makes use of UserControls for the reusable components. Unfortunately, I can't figure out how to bring these over to my new MVC 4 project.

Can someone please tell or show me how to do this?

您是否尝试将“ Inherits System.Web.UI.Page”更改为“ Inherits System.Web.Mvc.ViewPage”以使其成为视图!

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