Questions tagged [asp.net-mvc-areas]

An organizational concept present in ASP.NET MVC, that allows the developer to partition a large web application into smaller units.

An organizational concept present in ASP.NET MVC, that allows the developer to partition a large web application into smaller, distinct units. Areas might be used to, for instance, divide an application into inventory, review, storefront, and administration modules.

More information

575 questions
9
votes
1 answer

Why are my Area specific Web API’s accessible from all other Areas?

I am currently working on a ASP.NET MVC 4 Web Application project that must adhere to the following design decisions: The main MVC application resides in the root of the solution. All administrator functionality resides in a separate area. Each…
Martin Devillers
  • 17,293
  • 5
  • 46
  • 88
8
votes
1 answer

ASP.NET MVC area namespace problem

I create a new area in my asp.net mvc 3 solution named admin. Visual studio automatically assign the names space: MyApp.areas.admin.controllers I change this to MyApp.admin.controllers But it stops resolving the action. Any help in this regard will…
Shakeeb Ahmed
  • 1,778
  • 1
  • 21
  • 37
8
votes
1 answer

MVC Areas - Non Area Route Resolves To Area

I have added an area to my MVC 3 project. I cannot seem to get routing working with a very simple scenario. It seems to always want to resolve to the area. Here is my configuration. At…
Tim Scott
  • 15,106
  • 9
  • 65
  • 79
8
votes
1 answer

ASP.net MVC - Sharing partials between areas

is there some way to share a partial razor view between areas? For example a login partial, it is found if i use @Html.Partial("_LoginPartial") but the URLs Html.ActionLink generates are local to the calling area (even though the partial itself is…
Fionn
  • 10,975
  • 11
  • 54
  • 84
8
votes
2 answers

Are nested Areas possible in ASP.NET MVC 2?

I would like to create a project structure with nested areas. For instance I have a "Home" area and underneath this I would like the "News" area that handles it's own route registration and will properly find views when a route points to a…
newguy
  • 101
  • 1
8
votes
2 answers

Generated WEB API Help Area documentation does not show response body formats/samples

I have created a help area documentation fro my web api 2 projects (based on owin/katana). I turned on everything setting in the config and installed Microsoft.AspNet.WebApi.OData. Currently I have the following settings: config.SetSampleObjects(new…
8
votes
1 answer

How to protect an entire MVC Area by IP/Role/User?

I know in MVC at the top of a controller you can use the [Authorize()] attribute to restrict access to that entire controller to certain authenticated users and/or roles, but not by IP, but this must be done on a per controller instance. Is there a…
user1365911
8
votes
4 answers

Url.Action for mvc3 application hosted in a sub directory

I have deployed a mvc3 application in web. How can i add Virtual directory name in Url.Action() method ? for eg : my application is in mydomain.com\app now when i do Url.Action returns action="/Home/Create" but what i want is action =…
Nitin Kabra
  • 3,146
  • 10
  • 43
  • 62
8
votes
1 answer

MVC4 MEF plugins and controllers namespaces

I'm trying to create an MVC4 web app using a number of plugins, i.e. essentially controllers exported via MEF plus content files unpacked into their proper locations. I found a lot of material about MVC plugins, mainly related to areas, but I had to…
Naftis
  • 4,393
  • 7
  • 63
  • 91
7
votes
1 answer

Adding Areas to an MVC application - any gotchas?

I have an ASP.net MVC application that has been in Production for a while. I would like to add a new Admin section to the application which I wanted to do by creating a new Area. I'm just curious what sorts of things I might need to be aware of when…
Dismissile
  • 32,564
  • 38
  • 174
  • 263
7
votes
3 answers

Controllers split by areas

Possible Duplicate: How do I register a controller that has been created in an AREA I have the question - is it possible to do the next? I have three Areas: _Default SiteOne SiteTwo Inside each area i have a ApiController with the same name, but…
7
votes
2 answers

"No route in the route table matches the supplied values" when using Areas

I know this error has popped up for people before, but this seems to be a bit of a special case. I've been working on setting up a SPA with ReactJS on top of ASP.NET MVC 4. I've had no problem getting things working on my machine. However, the…
7
votes
1 answer

MVC5 Log Off link fails from different Areas

I have an MVC5 application with a number of different Areas. The project was created with a Log Off link in the navbar, but if the user is in any of the Areas, the link is broken. I thought adding: new { area = "" } would point the link back to the…
7
votes
2 answers

Controller with same name as an area - Asp.Net MVC4

I have a Contacts controller in the main/top area, and I have an area named "Contacts". I get POST 404s to the Contacts controller if I register my areas before I register my top-level routes: protected void Application_Start() { …
Trober
  • 259
  • 1
  • 2
  • 8
7
votes
1 answer

Is the default area for Html.BeginForm always the current area in ASP.NET MVC?

I had the following piece of code in my Razor Layout view (which is shared by all views in my application): @using (Html.BeginForm("Logout", "Account", FormMethod.Post, new { id = ViewIDs.Shared._AuthenticationPartial.LogoutForm })) { This worked…
Fabian Schmied
  • 3,885
  • 3
  • 30
  • 49