集成asp.net webforms和mvc

时间:2022-06-13 03:18:44

I am developing an asp.net mvc website product that needs to allow customers to add their own content pages, outside of the project.

我正在开发一个asp.net mvc网站产品,需要允许客户在项目之外添加自己的内容页面。

So the product will deliver a core set of pages (views) all using a master page. The clients can add their own web pages (.aspx) which I was hoping they could inherit from the MVC masterpage. Obviously there is no view context, so all of my html helpers, and Url.* calls fail.

因此,该产品将使用母版页提供一组核心页面(视图)。客户端可以添加他们自己的网页(.aspx),我希望他们可以从MVC主页继承。显然没有视图上下文,所以我的所有html助手和Url。*调用都失败了。

What would be the best strategy to allow someone to add web pages into an mvc product, re-using as much of the structure as possible.

允许某人将网页添加到mvc产品中的最佳策略是什么,重新使用尽可能多的结构。

2 个解决方案

#1


What you are describing is a Content Management System. There are a number of those available for MVC. One of them is N2. N2 is a lightweight CMS framework to help you build web sites that anyone can update:

您所描述的是内容管理系统。 MVC有很多可用的。其中一个是N2。 N2是一个轻量级CMS框架,可帮助您构建任何人都可以更新的网站:

http://n2cms.com/

Another one is Oxite. Oxite is a pure MVC CMS:

另一个是Oxite。 Oxite是纯MVC CMS:

http://www.codeplex.com/oxite

These are open-source, so you can break them open and see how they did it.

这些都是开源的,所以你可以打开它们,看看它们是如何做到的。

#2


Scott Hanselman's blog post on how to mix together these technologies is required reading for anyone wanting to use ASP.NET MVC and classic ASP.NET together.

Scott Hanselman关于如何将这些技术混合在一起的博客文章是任何想要将ASP.NET MVC和经典ASP.NET结合使用的人阅读的。

Plug-In Hybrids: ASP.NET WebForms and ASP.MVC and ASP.NET Dynamic Data Side By Side

插件混合:ASP.NET WebForms和ASP.MVC以及ASP.NET动态数据并排

#1


What you are describing is a Content Management System. There are a number of those available for MVC. One of them is N2. N2 is a lightweight CMS framework to help you build web sites that anyone can update:

您所描述的是内容管理系统。 MVC有很多可用的。其中一个是N2。 N2是一个轻量级CMS框架,可帮助您构建任何人都可以更新的网站:

http://n2cms.com/

Another one is Oxite. Oxite is a pure MVC CMS:

另一个是Oxite。 Oxite是纯MVC CMS:

http://www.codeplex.com/oxite

These are open-source, so you can break them open and see how they did it.

这些都是开源的,所以你可以打开它们,看看它们是如何做到的。

#2


Scott Hanselman's blog post on how to mix together these technologies is required reading for anyone wanting to use ASP.NET MVC and classic ASP.NET together.

Scott Hanselman关于如何将这些技术混合在一起的博客文章是任何想要将ASP.NET MVC和经典ASP.NET结合使用的人阅读的。

Plug-In Hybrids: ASP.NET WebForms and ASP.MVC and ASP.NET Dynamic Data Side By Side

插件混合:ASP.NET WebForms和ASP.MVC以及ASP.NET动态数据并排