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
7
votes
4 answers

Java Equivalent for ASP.NET MVC Areas

Areas, in ASP.NET MVC, are handy for breaking a site into smaller, manageable components at a higher level than controllers. They are like mini-MVC pieces within a web application. Is there an equivalent concept in any Java MVC framework to ASP.NET…
Aj-itator
  • 211
  • 3
  • 6
7
votes
5 answers

Getting System.Web.Optimization to work in a razor view within a class library

I'm building a modular MVC4 app, where each module (=area) is a class library. Models and controllers compile into the .dll, the views get copied into the appropriate folder. At runtime, everything works fine. At design time there is one annoying…
6
votes
1 answer

How do I test area registration logic in MVC 3?

I have simple HttpApplication class: public class MvcApplication : HttpApplication { public void Application_Start() { // register areas AreaRegistration.RegisterAllAreas(); // register other stuff... } } My…
6
votes
3 answers

asp.net MVC 3 applying AuthorizeAttribute to areas

I'm currently writing an Admin MVC 3 site, and each user only has access to certain parts of the site. The areas of my site are the same as the user Roles, so what I would like to do is the put the AuthorizeAttribute on each area, using the area's…
6
votes
2 answers

Mapping Subdomains to Areas in ASP.Net Core 3

What I want to achieve Mapping my normal domain e.g. example.com to no area if possible. Mapping my subdomain e.g. blog.example.com to a area named blog. What I have found There are actually quite a lot of posts regarding to this topic, especially…
Twenty
  • 5,234
  • 4
  • 32
  • 67
6
votes
2 answers

Area-global filters in MVC 3

Since it doesn't appear to be supported natively, what's the recommended way of implementing global filters on a per-area basis?
Richard Szalay
  • 83,269
  • 19
  • 178
  • 237
6
votes
3 answers

Asp.net MVC - Render a partial View From an Area

I've created an area that will handle our some generic things across all our development products, just as log ins, HTML helpers, etc. Inside the area, I have a partial view that I'm attempting to reference outside of the area. I've registered the…
DavidAndroidDev
  • 2,371
  • 3
  • 25
  • 41
6
votes
3 answers

Get Areas associated with an MVC project

Is there a way I can get the names of the areas in an MVC project? Here's a few ways I can think of: a) If I had the source, I could browse through the project folder structure and enumerate the folders under the Areas folder. But that wouldn't…
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
6
votes
1 answer

MVC Area Error Handling

I have a MVC project set up with 3 areas. In the main project I have error handling set up using custom errors in the web.config.
user415394
  • 303
  • 2
  • 5
  • 11
6
votes
2 answers

Reuse an MVC area in multiple MVC applications?

I have some common web pages that will be in multiple MVC applications. For those pages I'd like to reuse the same source code (controllers + views) between the different MVC web sites. What is the best way to go about doing this? ASP.NET MVC areas…
James Newton-King
  • 48,174
  • 24
  • 109
  • 130
6
votes
3 answers

Cant add new area in Visual Studio 2013 / ASP.NET MVC 5.1

If I right click an MVC website project and choose Add->Area... then type in the area name and hit "Add". I get : "There was an error running the selected code generator: 'Value does not fall within the expected range'" All my colleagues also…
6
votes
2 answers

Durandal and MVC4 Areas for multiple SPAs

I have a internet application mvc4 with areas, for my organization each area represent a SPA and through "Manage NuGet Package" I installed "Durandal 1.2.0", "Durandal Transitions 1.2.0" and "Durandal Router 1.2.0". I organized the folders and quit…
kuskunko
  • 330
  • 6
  • 17
6
votes
1 answer

Is it possible to use different layouts in MVC4 based off of routes?

I have a separate section (route) of my website that I would like to use a different layout/css etc. So when users at the main section of my website they get the default layout. But when they log in and go to the store, the store section (route)…
5
votes
1 answer

ASP.NET MVC 4 - 2 Areas With Segments, 1 Area Without

I've just created a fresh ASP.NET MVC 4 solution and have added 3 Areas and would like them routed as indicated: 1. General -> http://www.mysite.com/ 2. Members -> http://www.mysite.com/members/ 3. Administration ->…
Bern
  • 7,808
  • 5
  • 37
  • 47
5
votes
3 answers

ASP.NET MVC3 Area controller accessible from global routes?

Perhaps I do not understand correctly how MVC Areas work, but this has got me a little confused. Add an Area called "MyArea" using right-click "Add Area" in Visual Studio on the MVC3 project Create a controller for MyArea: "AnArea" with matching…
Duane
  • 670
  • 1
  • 6
  • 9