areas

relative path in stylesheets within asp.net mvc areas

[亡魂溺海] 提交于 2021-01-27 05:06:24
问题 I have a project with the current structure My Project /Content /Controller /View /Model /Areas /Area1 /View /Controller /Model /Area2 /View /Controller /Model All of the area views are using a root shared _Layout view which is referencing a css file under the root content directory. The css file under the content folder is referencing images or other content with the same directory like below: .box-shadow { -webkit-box-shadow: 0px 5px 80px #505050; -moz-box-shadow: 0px 5px 80px #505050; box

relative path in stylesheets within asp.net mvc areas

泪湿孤枕 提交于 2021-01-27 05:04:59
问题 I have a project with the current structure My Project /Content /Controller /View /Model /Areas /Area1 /View /Controller /Model /Area2 /View /Controller /Model All of the area views are using a root shared _Layout view which is referencing a css file under the root content directory. The css file under the content folder is referencing images or other content with the same directory like below: .box-shadow { -webkit-box-shadow: 0px 5px 80px #505050; -moz-box-shadow: 0px 5px 80px #505050; box

MVC 2 Beta DefaultControllerFactory with Areas

醉酒当歌 提交于 2020-01-17 03:30:13
问题 Why default factory WON'T return full name of the controllers (with namespaces)? I'm using Service Locator and autofac. using System.Web.Mvc; using Microsoft.Practices.ServiceLocation; namespace Application.Core.MVC { public override IController CreateController(System.Web.Routing.RequestContext requestContext, string **controllerName**) { return ServiceLocator.Current.GetInstance<IController>(controllerName); } } I had two home controllers (one under area Blog) http://localhost/Home http:/

ASP.NET MVC 2 Areas and AfterBuildCompiler

[亡魂溺海] 提交于 2019-12-23 04:43:17
问题 I am just trying out Areas in ASP.NET MVC 2 and I've hit a small issue. I've added the appropriate lines to my project file: <Target Name="AfterBuild" DependsOnTargets="AfterBuildCompiler"> <PropertyGroup> <AreasManifestDir>$(ProjectDir)\..\Manifests</AreasManifestDir> </PropertyGroup> <CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Child" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" /> </Target> But the problem I have is that I get the

Areas in asp.net mvc, only one work at time

余生颓废 提交于 2019-12-22 14:54:14
问题 My folder look like this: (root)/Areas/Admin/Views/.. (root)/Areas/Admin/Controllers/... (root)/Areas/Admin/Routes.cs (root)/Areas/Forum/Views/.. (root)/Areas/Forum/Controllers/... (root)/Areas/Forum/Routes.cs public class Routes : AreaRegistration { public override string AreaName { get { return "Admin"; } } public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Admin_Default", "{controller}/{action}/{Id}", new { controller = "Admin", action = "Index", Id =

ASP.NET MVC 2 RC 2 returns Area-specific controller when no area specified

家住魔仙堡 提交于 2019-12-22 07:37:06
问题 I have a basic MVC 2 (RC2) site with one base-level controller ("Home"), and one area ("Admin") with one controller ("Abstract"). When i call http://website/Abstract - the Abstract controller in the Admin area gets called even though i haven't specified the Area in the URL. To make matters worse - it doesn't seem to know it's under Admin because it can't find the associated view and just returns: The view 'Index' or its master was not found. The following locations were searched: ~/Views

ASP.NET MVC 2 RC 2 returns Area-specific controller when no area specified

两盒软妹~` 提交于 2019-12-22 07:36:07
问题 I have a basic MVC 2 (RC2) site with one base-level controller ("Home"), and one area ("Admin") with one controller ("Abstract"). When i call http://website/Abstract - the Abstract controller in the Admin area gets called even though i haven't specified the Area in the URL. To make matters worse - it doesn't seem to know it's under Admin because it can't find the associated view and just returns: The view 'Index' or its master was not found. The following locations were searched: ~/Views

MVC5 Routing Go to specific Areas view when root url of site is entered

青春壹個敷衍的年華 提交于 2019-12-11 11:05:17
问题 I'm not even sure I know the right terminology to articulate this correctly. I'm new to MVC and have inherited a partially complete project. The project uses Areas, I don't understand MVC and routing enough to resolve the following: I have a site eg "www.b2c.com" and have an area "OnlineOrder" controller "Home" and view "Index". I want visitors to go to by default when they enter the url "http://www.b2c.com" --> OnlineOrder/Home/Index the url "http://www.b2c.com/OnlineOrder/Home/Index" works

Can I nest areas in ASP.NET MVC?

 ̄綄美尐妖づ 提交于 2019-12-11 06:43:42
问题 I want the follow URLs in my MVC application: /Admin/Accounts/Groups /Admin/Accounts/Users I know I could create an Area named Admin , and then create Groups and Users controllers inside that area. Could I instead create nested areas? (An Area named Admin , and inside of this area an Area named Accounts ) 回答1: To accomplish your desired URL above, just specify it in the route configuration of your "Admin" area like this: public override void RegisterArea(AreaRegistrationContext context) {

How do I not instantiate an instance of Cassini for each Area in my application?

一笑奈何 提交于 2019-12-08 05:54:11
问题 I've been implementing areas, but have found that it instantiates a development server for each area when it launches Cassini. Is this really necessary? MSDN is having me setup these areas as separate web apps, Why can't I put them into class libraries? 回答1: Yes, you can get them down to class libraries. You may want to look into what the guys at MVCContrib are doing. They are calling it portable areas which gives you the libraries that you were asking for. They use their own Embedded view