Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Update Global.asax.cs:


Code Block
using N2.Web.Mvc;
           public static void RegisterRoutes(RouteCollection routes)
           {
                routes.MapContentRoute("Content", N2.Context.Current);

Add a HomePage content item:

Code Block
namespace VanillaApplication.Models
{
     [N2.PageDefinition]
     public class HomePage : N2.ContentItem
     {
     }
}

Update the HomeController:

Code Block
     [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.