c# - AreaRegistration is not working in MVC Razor -


i have added area called blogging in site created stuffs , tried access in browser manually entering url getting error "server error in '/' application.". have attached code , snapshot of project. 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         {             { return "blogging"; }         }          public override void registerarea(arearegistrationcontext context)         {             context.maproute("blogging_default", "blogging/{controller}/{action}/{id}", new {action="index",urlparameter.optional });         }     } } 

folder structure:

architecture

error:

browser error

specify id parameter optional adding "id = " front of urlparameter.optional

new {action="index", id = urlparameter.optional } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -