Integrate N2 into an Existing MVC Site
Update Global.asax.cs:
using N2.Web.Mvc; public static void RegisterRoutes(RouteCollection routes) { routes.MapContentRoute("Content", N2.Context.Current);
Add a HomePage content item:
namespace VanillaApplication.Models { [N2.PageDefinition] public class HomePage : N2.ContentItem { } }
Update the HomeController:
[N2.Web.Controls(typeof(Models.HomePage))] public class HomeController : Controller { public ActionResult Index() { ViewData["Message"] = "Welcome to ASP.NET MVC!"; return View(); } }
Compile and run. You should be directed to the N2 installation.
, multiple selections available,
Related content
Deploying N2 to a web server
Deploying N2 to a web server
More like this
Getting Started using N2CMS
Getting Started using N2CMS
More like this
"Dinamico" Razor Content Registration
"Dinamico" Razor Content Registration
More like this
Using externally/CDN-hosted libraries
Using externally/CDN-hosted libraries
More like this
Dinamico Part Tutorial
Dinamico Part Tutorial
More like this
Getting Support
Getting Support
More like this