asp.net-mvc-3-areas

MVC 3 Won't Serve Content files from Areas subfolder

自古美人都是妖i 提交于 2019-12-03 06:18:26
问题 I have an MVC3 application with a couple of areas and a portable area as well (using MVCContrib) Normally, I keep all my content files under ~/Content and my scripts under ~/Scripts. However, I am building a fairly complex webclient to another service on my site and I want to organize those javascript and image files (LOTS of image files and resources) under the Area's folder structure, which looks something like this, under ~/Areas/WebClient Content css fonts images js Controllers Models

MVC 3 Won't Serve Content files from Areas subfolder

人走茶凉 提交于 2019-12-02 20:51:59
I have an MVC3 application with a couple of areas and a portable area as well (using MVCContrib) Normally, I keep all my content files under ~/Content and my scripts under ~/Scripts. However, I am building a fairly complex webclient to another service on my site and I want to organize those javascript and image files (LOTS of image files and resources) under the Area's folder structure, which looks something like this, under ~/Areas/WebClient Content css fonts images js Controllers Models Views I have a resource aggregator controller (one of my portable areas) that is able to reach into the

Different authentication mode for different areas

醉酒当歌 提交于 2019-12-01 17:49:54
I have two portions of a website I am working on: one that uses normal forms authentication and another that uses an HMAC-based authentication. The forms based one works just as normal (except using a custom membership provider). The most frustrating thing is that by default, if one decides to use the forms authentication it redirects all 401 responses to the loginUrl specified in the root Web.config under the authentication tag. In an effort to turn this off for the HMAC portion of my site I have created a separate area that those controllers live in. However, no matter where I put a

Different authentication mode for different areas

坚强是说给别人听的谎言 提交于 2019-12-01 17:19:28
问题 I have two portions of a website I am working on: one that uses normal forms authentication and another that uses an HMAC-based authentication. The forms based one works just as normal (except using a custom membership provider). The most frustrating thing is that by default, if one decides to use the forms authentication it redirects all 401 responses to the loginUrl specified in the root Web.config under the authentication tag. In an effort to turn this off for the HMAC portion of my site I

MVC 3 does not look for views under Areas

我与影子孤独终老i 提交于 2019-12-01 03:16:15
I'm using multiple areas in MVC 3 and I'm having problems with my views not being found. The routing seems to pick up my controllers correctly (all the actions are executing without any problems), but when I return a view MVC simply doesnt find it. So if I have a simple controller called 'Thing' in an area called 'Some' and I do the following... public ActionResult Index() { return View("Index"); } The action is executed correctly, but MVC doesn't find the view and I'll get a message saying something like The view 'Index' or it's master was not found... And it will show me all the searched

ASP.NET MVC 3 Areas and multiple authentication in web.config

廉价感情. 提交于 2019-12-01 03:14:07
I have been attempting to follow this blog to get Areas working: http://mstechkb.blogspot.com/2010/10/areas-in-aspnet-mvc-20.html In the blog post, it identifies the ability to have authentication set per Area, e.g.: <location path="Area1"> <system.web> <authentication mode="Windows" /> <authorization> <allow roles="role1,role2"/> <deny users="*"/> </authorization> </system.web> </location> However, when I try to create this in a new project in Visual Studio 2010 I get the following error when I run: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond

MVC 3 does not look for views under Areas

落爺英雄遲暮 提交于 2019-11-30 23:23:43
问题 I'm using multiple areas in MVC 3 and I'm having problems with my views not being found. The routing seems to pick up my controllers correctly (all the actions are executing without any problems), but when I return a view MVC simply doesnt find it. So if I have a simple controller called 'Thing' in an area called 'Some' and I do the following... public ActionResult Index() { return View("Index"); } The action is executed correctly, but MVC doesn't find the view and I'll get a message saying

A route named “x” is already in the route collection. Route names must be unique. Exception with ASP.NET MVC 3

吃可爱长大的小学妹 提交于 2019-11-27 11:44:26
I'm doing an ASP.NET MVC 3 web service and I keep getting this exception intermittently. Stack trace: Server Error in '/' Application. A route named 'ListTables' is already in the route collection. Route names must be unique. Parameter name: name Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: A route named 'ListTables' is already in the route collection. Route names must be unique. Parameter name:

A route named “x” is already in the route collection. Route names must be unique. Exception with ASP.NET MVC 3

ぐ巨炮叔叔 提交于 2019-11-26 15:44:00
问题 I'm doing an ASP.NET MVC 3 web service and I keep getting this exception intermittently. Stack trace: Server Error in '/' Application. A route named 'ListTables' is already in the route collection. Route names must be unique. Parameter name: name Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: A route

How to reuse Areas, Controllers, Views, Models, Routes in multiple apps or websites

可紊 提交于 2019-11-26 14:46:55
问题 I have a test solution which only has one area called Admin. I would like to reuse Admin across a number of other web applications. I have a web application setup in IIS, I have then added a virtual application, /Admin coming from Areas\Admin . When I navigate to /Admin, I see a directory listing. When I try to hit a controller, /Admin/News. I get a 404 error. It could be that the areas are not registering, even though the code is there in the global.asax. However, I am sure I am going about