asp.net-mvc-areas

The controller for path was not found or does not implement IController

笑着哭i 提交于 2019-11-26 17:35:19
问题 I have an MVC4 project with language selection: en nl fr de 1 main part with: About Common (for the menu) Contact Faq Home And 3 areas: Admin Customers Shop In each area I have at least one controller, for example in Admin I have the controller overview with the corresponding view folder overview which contains an index.aspx page. The home page and all the main pages (about, faq, etc.) work and can be visited). However, when I follow the url: localhost:xxxx/en/admin/overview I get the error:

Having issue with multiple controllers of the same name in my project

拈花ヽ惹草 提交于 2019-11-26 12:56:05
问题 I am running into the following error with my ASP.NET MVC 3 project: Multiple types were found that match the controller named \'Home\'. This can happen if the route that services this request (\'Home/{action}/{id}\') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the \'MapRoute\' method that takes a \'namespaces\' parameter. The request for \'Home\' has found the following matching

How to use an Area in ASP.NET Core

戏子无情 提交于 2019-11-26 12:08:30
问题 How do I use an Area in ASP.NET Core? I have an app that needs an Admin section. This section requires its Views to be placed in that area. All requests that start with Admin/ will need to be redirected to that area. 回答1: In order to include an Area in an ASP.NET Core app, first we need to include a conventional route in the Startup.cs file (It's best to place it before any non-area route): In Startup.cs/Configure method: app.UseMvc(routes => { routes.MapRoute("areaRoute", "{area:exists}/

How to specify an area name in an action link?

十年热恋 提交于 2019-11-26 11:56:18
问题 I have a shared master page which I am using from 2 different areas in my mvc 2 app. The master page has an action link which currently specifies the controller and action, but of course the link doesn\'t work if I\'m in the wrong area. I see no overload for actionlink that takes an area parameter, is it possible to do? 回答1: Figured it out.. Html.ActionLink("Link Text", "ActionName", "ControllerName", new { Area = "AreaName" }, new{}) 回答2: Something I ran into right after this, that I imagine