Is it possible to create an Area within an Area? - asp.net-mvc

Assuming I have to insert another MVC Project A with Area(s) into another MVC Project B. Which means I have to create an Area in MVC project B and insert the files with Area from MVC Project A

AFAIK nested areas are not supported. If you need that you might consider splitting your application into 2 separate applications. And inside the Admin application use areas.

Related

MVC Area using multiple solution

I am using below link to devide Area into multiple application.
http://geekswithblogs.net/cokobware/archive/2013/01/15/asp.net-mvc-4-pluggable-application-modules.aspx
Where, we create Area folder in one project and we provide the actual implementation in another project, which itself is created in the same path where Area folder lies in first application.
Our requirement is to create Areas in altogether different solution instead of a different project
I tried the same but it does not seems to be working.
Is it possible to create Areas in separate solution and call the views of that area from main MVC web application which has the Area folder?
Has anyone came across such situation?

Asp.net MVC - access Views from another solution/ Shared directory over the network

Hi I am Trying to separate Views , controller and model in 3 different solutions
And trying to access views from a shared directory means trying to access views in C drive and my solution is in D drive.
This is for a multi tenant application
You can separate models and controllers into another project. Your views need to be part of the main mvc application. Just make sure you add mvc using nuget to each and keep things together with namespaces and it should be fine.

Create separated MVC5 projects into same solution

I'm new to MVC. I created a ASP.NET MVC5 Login project (UI) using Razor engine that is authentication responsible by using OWIN (VS2013). ViewModels and Data for solution are separated and layered by DLL. I would like to create two separated MVC5 project (UI) into same solution, each one is like a subsystem (eg: Accounting project, Inventory project, etc). Always user has to pass authentication project (Login) first and then according its necessity navigate to Accounting or Inventory subsystem.
My goal is that I could add or remove subsystems when deploying according company negotiation that let it use one or any subsystem.
How can I achieve that?
Every subsystem must be created using a separated ASP.NET MVC5 project template or can be created by a separated DLL?
You can use areas. See http://www.codeguru.com/csharp/.net/net_asp/mvc/article.php/c20227/Using-Areas-in-ASPNET-MVC-Application.htm
What are Areas?
Areas are functionally independent modules of your ASP.NET MVC application that mimic the folder structure and conventions of MVC. Consider the following scenario :

Entity framework, repository layer and Asp.net MVC 4

I'm planning to create a web application using MVC 4 Single page application and I will use database first approach. And I'm using the default Sql Server LocalDB (with the login/authentication tables).
Where should I put the edmx file? Under the Model folder? What if I want to have a service layer/repository layer.
BTW, the default template of SPA create two classes for each model, for example TodoList.cs and TodoListDto.cs. Why and is there any better design to avoid two classes?
I like to start by creating a {DataLayer}-Project.
Add the EDMX file to your {DataLayer}-Project
Add a references (under references) from your main project to your {DataLayer}-Project
add using {DataLayer}-Project; in every file that makes reference to your Entities
When my project achieves optimum maturity, I change my {DataLayer}-Project into a service.

ASP.NET MVC 3 Structure - Go to view in another project

I've got the following project setup
Project A (main)
Business
Data
View (asp.net mvc 3 project)
Project N
Business
Data
View (asp.net mvc 3 project)
How can I call from Project A the View in Project N and from N back to A. Essentially what I'm trying to do is package each Project N to have its own individual MVC as it comes from different sources and plug it in to the main project and then just have it navigate to the correct view.
Can this be done? Or is there a better way to do this?
You could write a custom virtual path provider. Here's a nice blog post which shows an example of such a virtual path provider allowing you to embed Razor views into assemblies as resources and reusing them in multiple applications.
Unfortunately without a custom virtual path provider, you cannot cross reference views between multiple ASP.NET MVC applications. This simply is not allowed by the default provider which looks for views only inside the current application.
I do sugest another approach if possible. if I understood correctly, those projects are somehow ike plugins but they are not standalone applications.Also they now about each others so they are coupled. It's, let's say tricky, but I would use only 1 asp.net mvc project (the web ui). All the UI bits which belong to other projects I'd make them helpers (pretty much widgets). This means, that each project contains only the helpers which will be used to construct a view.
I think it's a bit of an architectural problem if you only want to keep the views in each project just for the sake of hosting them in a different assembly. Going the widgets' way it might seem mkore work, but I think you gain the most control and the separation level you want. The only thing is you don't have full Views defined, but why you would want to have full Views (partials, layouts) in separate places if they will be used in one place only?!
Now, if each project is indeed a plugin, independent of other plugins, then going with compiled views is the best way. But if Project B knows about the view of Project N, then I think the above solution is more suitable. That or the whole app is too over engineered. Separation is good when it doesn't create a whole new jungle to navigate it.

Resources