MVC and Umbraco integration

后端 未结 4 1013
甜味超标
甜味超标 2021-02-01 11:45

I\'ve followed the steps from http://memoryleak.me.uk/2009/04/umbraco-and-aspnet-mvc.html and integrated MVC in Umbraco with success, but I still have a problem which is critica

4条回答
  •  日久生厌
    2021-02-01 12:22

    Having had a look at the blog post it seems that this is not actually integrated with Umbraco but working alongside Umbraco.

    In that it is effectively its own HttpHandler. This means it is bypassing the Umbraco Httphandler and a whole bunch of Umbraco functionality relating to templates and the CMS itself.

    Getting MVC to utilise Umbraco templates is (probably) not possible without modifications to the core application (in version 4+). However that doesn't mean you can't use MVC alongside Umbraco with Umbraco acting as a content repository for a MVC application.

    You could easily create MVC controllers which pulled data from Umbraco and made that available to your views. For example you could use Umbraco Linq2Umbraco for this.

    If you give more details as to the precise errors you are getting and exactly what you are trying to achieve, it may be the solution is in how you structure your application rather than attempting to brute force Umbraco 4+ to do something that will be native in Umbraco 5 (which is scheduled for release some time this year). The source code for 5 is on Codeplex and may be a good place to have a look and see how the Umbraco core team are approaching this.

    There is an old discussion about this here: http://forum.umbraco.org/yaf_postst5106_Using-ASPNET-MVC-with-Umbraco.aspx

    and more recently here: http://our.umbraco.org/forum/getting-started/installing-umbraco/2668-Use-Umbraco-with-aspnet-MVC

    Further discussion can be found here: http://our.umbraco.org/forum/developers/extending-umbraco/17523-Umbraco-461-and-MVC-3

    and even more here: http://our.umbraco.org/forum/developers/extending-umbraco/6837-Umbraco-Website-And-MVC-Website-In-ONE

提交回复
热议问题