Solved

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

Posted on 2013-05-20
2
760 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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