Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Page History

« Previous Version 5 Current »

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.