I would appreciate any assistance with techniques/ strategies to implement the scenario below:
We need to have this kind of Folder structure of our ASP.NET MVC 5 site
Names are folders and FileNames are specified with Extentions.
Website Folder Structure:
- Root
- DisplayControls
- Product
- SimpleProductPage
- SimpleProductPage.cshtml
- Controls
- Image.cshtml
- ProductSpecification.cstml
- ProductPageWithImageGallery
- ProductPageWithImageGallery.cshtml
- Controls
- ImageGallery.cshtml
- ProductSpecification.cstml
- SimpleProductPage
- Category
- SimpleCategoryPage
- SimpleCategoryPage.cshtml
- Controls
- CateogryProducts.cshtml
- RelatedProducts.cshtml
- CategoryPage
- CategoryPage.cshtml
- Controls
- CateogryProducts.cshtml
- RelatedProducts.cshtml
- SimpleCategoryPage
- Product
- Controllers
- someControllerfiles.cs
- Views
- ProductView.cshtml
- CategoryView.cshtml
- SomeotherViews......
- OtherFilesAndFolders
- DisplayControls
Now If we want to request the Product Page then ProductView.cshtml will be Loaded from Controller and Inside that View we want to Load Some Display Control from "DisplayControls" Folder based on Database Entry. If the Entry says we need to Load "SimpleProductPage" Then We will Load the Views from "SimpleProductPage" Folder i.e. SimpleProductPage.cshtml and this View will have it's Controls i.e. Partial Views Loaded from it's Controls Folder. and if the Selected Display Control is "ProductPageWithImageGallery" then the Views from that Folder will be Loaded along with its child/Partial Views.
Same goes for Category Pages, based on the DB Entries, Respective Controls/Biews will be Loaded from that Folder.
So basically ProductView.cshtml and CategoryView.cshtml will act as Placeholder and the Selected Views/ChildViews will be loaded onto them runtime. As you can see our targeted Views are not located into Views Folder so that is a bit of problem for me.
I am new to MVC and we are using MVC 5, Can you people please help me how to implement this.