| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Webforms to MVC

Page history last edited by rhartzog 13 years, 11 months ago

Since no one had any experience with a brownfield migration using a mix of WebForms and ASP.NET MVC the discussion turned into an intro to MVC.  There were a few people who had questions regarding what MVC was and how it works.

 

It was discussed that MVC is a pattern that has been around for many years and one of the most modern and successful implementations of it is seen in Ruby on Rails. MVC stands for Model-View-Controller and aids in separating the business/domain logic from the presentation, or UI, logic.  In MVC the controller receives the input and marries the model to the view being presented to the user.  

 

Routes are a first class citizen in MVC, as they dictate the controller and action (methods) to be initiated which then dictates the model to use and view to display.  The default route out of the box in ASP.NET MVC is:

 

routes.MapRoute(

                "Default", // Route name

                "{controller}/{action}/{id}", // URL with parameters

                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults

 

When the home URL is called for your application domain, this route will used and will invoke the Index action on the Home controller as specified on the last line which holds the default parameters.

 

Comments (0)

You don't have permission to comment on this page.