ASP.NET Core - 1.pdf - Advanced.NET Server Development...

This preview shows page 1 - 11 out of 88 pages.

Advanced .NET Server Development ASP.NET Core Instructor: Mahboob Ali
Introduction to ASP.NET MVC Provides another approach (instead of Web Forms) to ASP.NET development with the following benefits: Improved testability ideal for TDD -Test Driven Development Reduced overhead of ViewState Complete control over HTML markup Better separation of concerns Embraces web standards (HTML, JavaScript, CSS) Open Source code available for modifications Remember that with the “One ASP.NET” philosophy both approaches are built on the same ASP.NET core and can be mixed into the same project
MVC vs Web Forms Built on Common Language Runtime Used to build Dynamic web sites Supported model 1 Supported 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) way Using a Visual Designer and dragging and dropping controls onto web forms Being abstracted from some of the details of the web Using 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 Configuration aka Conventions over Configuration to simplify configuration
Differences ASP.NET Web Forms ASP.NET MVC views tightly couples to logic Markups and code behind in one file view and logic separate Breaks up in separate layers pages (file-based URLs) Points two physical files on hard drive Controllers (route-based URLs) Points to controllers and controller actions state management (AKA View State) Use view state to store object across multiple requests no automatic state management (TempData available) Allows to copy data from one request to another Web Forms syntax only support multiple syntaxes (razor as default) But can also use web forms syntax master pages Layouts user controls partial views server controls HTML 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 components Use HTML/JS/CSS etc. Controllers: Handle user interactions Work with the model Select 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?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture