100%(1)1 out of 1 people found this document helpful
This preview shows page 1 - 11 out of 88 pages.
Advanced .NET Server DevelopmentASP.NET Core Instructor: Mahboob Ali
MVC vs Web FormsBuilt on Common Language RuntimeUsed to build Dynamic web sitesSupported model 1Supported model 2
MVC vs Web Forms•Initially intended by Microsoft for a small subset of ASP.NET applications which needed improved testability and more control over the HTML•However, ASP.NET MVC has been widely embraced by the ASP.NET community and has great “buzz” around it•Web Forms has received a major update in Visual Studio 2013 to “catch up” with some of the new features in MVC•Web Forms will continue to be supported going forward and will still be suitable for those who prefer:Working in the traditional visual (Windows Forms) wayUsing a Visual Designer and dragging and dropping controls onto web formsBeing abstracted from some of the details of the webUsing powerful stock GUI controls while sacrificing some control
MVC vs Web Forms•URLs in MVC do not map to a specific file but instead to a specific controller action•MVC relies on Conventions rather than Configurationaka Conventions over Configuration to simplify configuration
Differences ASP.NET Web FormsASP.NET MVCviews tightly couples to logic Markups and code behind in one fileview and logic separateBreaks up in separate layerspages (file-based URLs)Points two physical files on hard driveControllers (route-based URLs)Points to controllers and controller actionsstate management (AKA –View State)Use view state to store object across multiple requestsno automatic state management(TempData available)Allows to copy data from one request to anotherWeb Forms syntax onlysupport multiple syntaxes(razor as default)But can also use web forms syntaxmaster pagesLayoutsuser controlspartial viewsserver controlsHTML helpers
One ASP.NET•Welcome to Web Development Buffet !!!
Model, Views and Controllers•Models:Holds logic for the application's data domain.Contains domain classes and business logic. Often, deals with DB•Views:Represents UI componentsUse HTML/JS/CSS etc.•Controllers:Handle user interactionsWork with the modelSelect a view to render
ASP.NET MVC Working
Question•It’s perfectly possible to build a static web application without the use of a web framework, Can you think of an advantages and some disadvantages of building such application?