I am working on a small ERP Application and using MVC5 for it.
I have several Modules in the application and each module contain several web pages (Views, you can say).
i.e: for School application
I have LibraryManagement/Hostel Management
Now under view folder I want to create my folder structure as following:
Views
- Library [Physical Folder]
- BookManagement [Controller]
- Add/Edit/Delete Book Detail. [Action Based Views]
- Issue Book.
- Generate Library Card
- BookManagement [Controller]
- Hostel [Physical Folder]
- RoomInfo [Controller Name]
- AddRoom [Action Based View]
- EditRoom [Action Based View]
- ListRoom [Action Based View]
- Assign Room [Controller]
- AssignRoom [Action Based View]
- Manage Fees
- EditFeesInfo [Action Based View]
- RoomInfo [Controller Name]
Please help me how can I create this structure in MVC 5.
MVC is a separation of concerns, hence, your controllers should never be in your Views folder (and vice versa). If I were you, I’d simply create a folder “Library” and “Hostel” in your project root. Then add a “Controllers” and “Views” folder for each. I suppose both share the same Models, so I’d put these in a separate folder in the root.
If you really want to separate the “Library” and “Hostel” part in your application, you can work with Areas.
2