ASP MVC Route Config - The resource cannot be found error
Revision 1
I'm newbie in asp mvc, currently, my demo project structure like this:
Areas -- Comment -- Controller -- HomeController
-- ManageController
Controller -- HomeController
|-- CommentController
|____ PostMsg
|____ DeleteMsg
When I browsing url like :
http:
http:
Anyone have any idea why asp mvc doesn't resolve my controller :-(
here is my global.asax.cs route config:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "Demo.Web.Controllers" }
);
here is my area registration route config:
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Comment_default",
"Comment/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new[] { "Demo.Web.Areas.Comment.Controllers" }
);
}
Any help would be appreciated :-)
Posted 7-Nov-12 4:27am
by
Van Hua.