I have added a area called blogging in my site I created all the stuffs and I just tried to access it in the browser by manually entering the Url but I am getting error like "Server Error in '/' Application.". I have attached the code and snapshot of my project. Any help would be appreciated.
Global.Asax
public static void MyCustomRouting(RouteCollection coll)
{
coll.IgnoreRoute("{resource}.axd/{*pathInfo}");
coll.MapRoute("Default", "{controller}/{action}", new { controller = "Home", action = "Index" }, new[] { "Areas.Controllers" });
}
protected void Application_Start()
{
//RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
MyCustomRouting(RouteTable.Routes);
}
BloggingAreaRegistration.cs
using System.Web.Mvc;
namespace MVC_PageRouting.Areas.Blogging
{
public class BloggingAreaRegistration : AreaRegistration
{
public override string AreaName
{
get { return "Blogging"; }
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute("Blogging_default", "Blogging/{controller}/{action}/{id}", new {action="Index",UrlParameter.Optional });
}
}
}
Folder Structure:
Error: