asp.net-mvc-areas

Create url based on mapped route or constraint?

I'm creating a generic editor for asp.net mvc pages and would like to generate/create urls when I create new items of a specific type. My editor is located under mysite.com/dashboard and I load different models into the same views using the same generic DashboardController. So how can I create urls based on the mapped route or constraint...

How to enumerate Areas in ASP.NET MVC 2 RC

My controller has to enumerate all the areas in the application. Is it possible? And how? ...

ASP.NET MVC 2 area namespace assignment

Suppose the root project has My.Root.Project namespace. I wonder what namespace should be assigned to an area classes? Possible alternatives: My.Root.Project.Areas.Area1 My.Root.Project.Area1 Esthetically, I prefer second one. However, since I use a single-project areas, all the classes created within Areas\Area1\... folder are given...

ASP.Net MVC: Creating an Area for json requests...

Hey guys Just wondering what people think about creating an area to hold/manage json based requests (note I am thinking mostly get data not post data). I know its not your typical use of an area (i.e. normally you would create a different area for blog vs forum) but I am getting to the point where my project isn't huge but I definitely...

ASP.NET MVC 2 RC areas and shared models

Once new area is created by the means of Visual Studio context menu, there are three folders: Controllers, Models, Views. Is it supposed that every area should have it's own model classes? Or is it acceptable/widely-used/good for all areas to share the same model classes in the root Models folder? My project differs Domain Model and Vi...

Sharing partial views between MVC projects - Do Areas Help?

Hi, We have some partial views which need to be used in several MVC projects. Has anyone done this successfully? Could Areas in MVC 2 be of any use ? Could a sub area project use a partial view from the parent project or the other way around? Thank you ! ...

ASP.NET MVC 2 | Load Area at Runtime

I'm trying to figure out the best way (or if it is possible) to decide if an Area should be loaded based on some runtime parameter. I only want certain Areas available in certain situations. Is there a "best practices" around this. A better way to ask this question may be, can you register the routes of an area at Runtime or Session_St...

This code doesn't seem to work in ASP.NET MVC2 ... what is it's equivalent, please?

Hi folks, i have this code which I doesn't seem to work in my copy of VS2010 B2 / VS2010 RC. var areaName = controllerContext.RouteData.GetAreaName(); (originally sourced from here). Now, it's dealing with Area's, so it's definately MVC 2 stuff. The error message is that the method GetAreaName() doesn't exist. Does anyone know the...

ASP.NET MVC Multi Project Areas Questions with setup

Hello, For those who setup muli project areas in ASP.NET MVC 2 in VS 2010, I have a few questions for you: Can other project areas use one master page? Or does each have to have their own master page? What about the web.config file? Does each area need the config file? Or does it rely on the master? I tried removing the master page...

asp.net mvc area problem: The view 'Index' or its master was not found.

The view 'Index' or its master was not found. The following locations were searched: ~/Views/ControllerName/Index.aspx ~/Views/ControllerName/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx I got this error when using ASP.Net mvc area. The area controller action are invoked, but it seems to look for the view in the 'base...

Set default area - Avoiding `, new {area = ""}` on each link on the site.

This code is inside the master page: <li><a href="<%=Url.Action("Action", "Controller") %>">Main site link</a></li> <li><a href="<%=Url.Action("AreaAction", "AreaController", new {area = "Area"}) %>">Area link</a></li> All the links works good till I'm going to the Area Link. When I go there all the routes of the main area don't wor...

asp.net mvc area - best prectice

I'm currently building a CMS system, and I need to have an easy way include or exclude components. My first think was to use asp.net mvc area feature, to identified each component on itself. But from what I see, the area feature has problems, so maybe it not that good idea. What you guys think? What ways we have in asp.net mvc achieve...

How can we set authorization for a whole area in ASP.NET MVC?

I've an Admin area and I want only Admins to enter the area. I considered adding the Authorized attribute to every controller in the Admin area. Isn't there an elegant solution or is this feature not there in the framework itself? EDIT: I'm sorry, I should to have mentioned this before. I'm using a custom AuthorizedAttribute derived fro...

How to specify default Area without adding area = "" to every ActionLink

I have a large existing application built on ASP.NET MVC2 RC2. All of my links look like this: htp//site/controller/action/id I just added an Area called: BigBird. Now when I'm in the BigBird area, all of my links look like this: htp://site/BigBird/controller/action/id Problem is that none of those controllers/actions exist in my n...

How can I know which Area my MVC controller action is being called in?

I want to know how, from a controller action, I could identify the area in which the controller is in via the MVC framework (I mean, without making all controllers in a given area inherit from a base controller with that info). I'm particularly interested in the case of child actions (controller actions rendered via RenderAction), the ...

Providing or Filtering assemblies when registering areas for an ASP.NET MVC 2.0 application

I have a large application that currently exists as a hybrid of WebForms and MVC 2.0. Startup of my application is dreadful, and the culprit is primarily because of the AreaRegistration.RegisterAllAreas call. More specifically, that it is using the System.Web. Compilation.BuildManager.GetReferencedAssemblies to enumerate all types in ass...

Syntax to specify Namespace when using helper.RouteUrl

I am using Asp.Net MVC 2 - RC w/ Areas. I am receiving an ambigious controller name exception due to having same controller name in two different areas. I've read Phil Haack's post Ambiguous Controller Names With Areas I can't figure out the syntax when trying to use UrlHelper (I have an extensions class). e.g. public static string ...

Intellisense not working for ViewModel for MVC2 project in ASP.NET MVC2 RTW

I upgraded to MVC2 RTM with VS2010 RC and some of my ViewUserControl and Page controls don't show intellisense for simple things like <%= Html..... %> or <%= Model... %> ...

StringTemplate view engine and Areas

Hello I have a problem combining StringTemplate view engine and Areas, i don't know what to do so paths can be recognized. Anyone tried that combination? ...

Is there a MVC SiteMap Provider that supports ASP.NET MVC 2 Areas feature ?

Hi all, I am looking for a MVC SiteMap provider in which I can specify area as well, along with controller and action. Did anyone use a SiteMap provider that supports MVC 2 Areas ? Help will be greatly appreciated in this regard. Thanks ...