Solved

ASP.Net MVC 4 C# -- one BIG page vs. multiple pages ?

Posted on 2013-05-20
2
762 Views
Last Modified: 2013-05-23
I have about 10 programs (Buick, Ford, Chevy, etc) that are very workflow driven.

a. What option would you pick ?
b. What "workflow" engine (windows workflow foundation, etc) would you use for this MVC project ?

I like "Option #1" because it is one page to code,
but don't like since it has lots of if/then statements, etc
making the code hard to easily review/tweak.
------------------------------------------------------------------------------------------------------------------------
Option #1 --> do via on one COMPANY-WIDE "matReq.cshtml"
 1. create \Controllers\CarController.cs, RMB on INDEX method, new, VIEW
 2. open \Views\Car\Index.cshtml, make HTML changes
 3. open \Views\Shared\_Layout.cshtml, add below
      ** <li>@Html.ActionLink("Buick testing", "Index", "Car")</li>
      ** <li>@Html.ActionLink("Ford testing",  "Index", "Car")</li>
      ** <li>@Html.ActionLink("Chevy testing", "Index", "Car")</li>
 4. do some type of if/then statements on the one COMPANY-WIDE matReq.cshtml
      ** if passed in link = Ford, then
           ** textbox1, textbox2, and textbox3 required
           ** workflow approved by four management levels
           ** only supervisors can edit "matReq.cshtml" stage #7 documents
           ** JohnDoe is a Ford supervisor per ASP.NET Web Site Administration Tool user group
      ** if passed in link = Chevy, then
           ** comboBOx4, textbox21, and textbox32 required
           ** workflow approved by seven management levels
           ** only contractors can edit "matReq.cshtml" stage #9 documents
           ** JohnDoe is a Chevy contractor per ASP.NET Web Site Administration Tool user group
      ** etc
----------------------------------------
Option #2 --> do via multiple "matReq.cshtml", one for each program
 1. create \Controllers\BuickController.cs, RMB on INDEX method, new, VIEW
 2. open \Views\Buick\Index.cshtml, make HTML changes
 3. open \Views\Shared\_Layout.cshtml, add below
      ** <li>@Html.ActionLink("Buick testing", "Index", "Buick")</li>
 4. repeat for other PROGRAMS (Ford, Chevy, etc)
0
Comment
Question by:finance_teacher
2 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 39184660
In Option 1 , you can do  the same in controller and return the relevant view instead of doing it in the view itself.
0
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 500 total points
ID: 39185564
Hi,

1. You can do this with a single controller with multiple models and views.

2. Or you can do this with a controller, model and views for each program.

Personally I would choose option number 2 because this way I can very easy tweak or review a specific program.
Also you can do abstraction even further to create a common interface or abstract class that implements the required methods for all programs and implement them in thier controllers, models and views.

Also you can integrate more easly the Windows Workflow Foundation workflows with different controllers, each having it's own workflow avoiding if statements.


Regards,
Mishu
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question