asp.net-mvc-areas

Models in asp.net mvc 3 areas

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 17:48:01
问题 How to organize models in multiple areas ? I am trying to organize code using areas. I am using visual studio 2010 express , the project is on asp.net mvc3 and code-first development is used. All the tutorial and reference over internet only talks about controllers and routes, but what about models ? more precisely, I am looking for suggestions around : The model folder in an area will contain its own classes, so where should the dbcontext be placed ? I already have an dbcontext class

How to publish an asp.net mvc 4 application with areas?

我只是一个虾纸丫 提交于 2019-12-12 04:57:22
问题 I have a asp.net mvc 4 application that has multiple area setup. However, this application uses multiple projects to make up this area as explained here to follow n-tier in the solution. The output path of these separate projects is set to the bin folder of the main mvc application which works fine. When I publish this main app on file system as target, the Areas folder that is created in the directory only has HelpPage folder content but no area folders. I would like to know how can I add

MVC3 RouteHandler result ignores Area in the resolved Route - why?

元气小坏坏 提交于 2019-12-12 02:41:22
问题 I am working on splitting an MVC3 Application into two Areas. The existing application is going into one area (V1) and we are beginning a redesign in the second area (V2). I have the Views, Models, Controllers, etc all moved into the MyApp\Areas\V1\xxx folders, and I have been able to verify that things are loading as they should for the most part. I moved all the Route registration for V1 into the V1AreaRegistration.cs file, and modified it to use context.MapRoute instead of RouteTable

goin back to my 'routes' - issue with partialviews and areas??

两盒软妹~` 提交于 2019-12-12 02:39:49
问题 i've hit another brick wall today with jquery generated partialviews when located within areas. it's a bit baffling as i have a number of partialviews located under ~/areas/administration/views/shared which all get rendered fine if included inside a normal view. However, if i invoke any of the same partial views via ajax, the controller action runs fine but i get an error. on closer inspection, the error reveals itself to be due to the partialview in question not being found by the view

How to code MapRoute in RegisterArea to route the area default to another area (web site root)

[亡魂溺海] 提交于 2019-12-12 02:13:30
问题 I want the user to be routed to the web site home page (\Home) if they access the area root url directly (\Products). What is the correct coding in the RegisterArea route.map? Here is the folder structure in the project and how they map to the web site /Area/Products -> /Products /View/Home - > /Home If users goes to / , then go to /Home (use the index action for controller Home) If users goes to /Products , then go to /Home (use the index action for controller Home) If users goes to

MapSpaFallbackRoute on Startup ASP .NET Core

旧时模样 提交于 2019-12-11 15:54:47
问题 I have an Areas on Net Core App named Admin , on MapSpaFallbackRoute setting on startup, I want to set like this, app.UseMvc(routes => { routes.MapSpaFallbackRoute( name: "spa-fallback-admin", defaults: new { area="Admin", controller = "Home", action = "Index" }); }); is this the correct way to define MapSpaFallbackRoute ? I doubt MapSpaFallbackRoute have attributes area , I have been try this, and my apps return 404(not found). so, what the correct way to define MapSpaFallbackRoute , I want

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

.net core routing to a razor pages area based on current domain name?

折月煮酒 提交于 2019-12-11 10:43:46
问题 I'm currently trying to architect a application to host multiple websites from a single .net core application. Ideally, I would like to show completely different Razor pages based on the domain name the application is being accessed from. Ideally, I would like to have my razor pages broken down into areas, where each area is associated with a different domain name. IE www.domain1.com is the domain1 area, www.domain2.com is the domain2 area, and each area has it's own index about page etc. So

In AspNet.Core the Tag Helper asp-area doesn't work

淺唱寂寞╮ 提交于 2019-12-11 05:39:00
问题 I recently updated the Visual Studio for Update 3 and ASP.Net Core for 1.0.0. I followed the tutorial in documentation and I tried set up for use Areas like this https://docs.asp.net/en/1.0.0/mvc/controllers/areas.html However, the link generated was http://localhost:2187/?area=Admin, instead of http://localhost:2187/Admin/Home/Index Update My routes: app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapRoute( name: "areaRoute

Mvc action returns 401 error

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:49:27
问题 This is a strange one. They always are when I get to this point. I have an MVC app. It's a single page app so all routes are ajax calls but I don't think this is relevant. Strangely and all of a sudden one particular page has started giving me a 401 and prompting for creds. Actually it's both pages that are in this MVC Area. It is only doing it in qa no locally so I can't debug. And It only started after last push. None of the other pages are doing this. So I compared the headers via fiddler