2. What is ASP.NET MVC?
Web Development Framework
The Most Up-to-date Ideas and Techniques from Agile
Development
The Best Part of ASP.NET Platform
It is a complete alternative to traditional ASP.NET Web Forms
3. Understanding the History of ASP.NET
.NET
A multi-language managed code platform
(brand new at the time – a landmark in its own right)
ASP.NET
A way to host .NET applications in IIS, letting you
interact
With HTTP requests and responses
ASP.NET Web Forms
A set of UI components (pages, buttons, etc.)
Pulse a stateful, object-oriented GUI
Programming model
4. • ASP.NET 1.0 was first released in 2002 (it was same thing with Webform)
• ASP.NET 2.0 was released in 2005 along with Visual Studio 2005
• ASP.NET MVC was announced in 2007
• ASP.NET 3.5 followed in 2008 and brought with it DynamicData, which enables you to
rapidly generate data-driven applications in minutes.
• ASP.NET 4 was released along with VS2010. At the same time ASP.NET MVC 4 was released
• ASP.NET 4.5 was released along with VS2012 in 2012. This release included ASP.NET MVC 4.5
• ASP.NET 4.5.1 was released along with VS2013. MVC 5.0
• ASP.NET 4.5.2 Update 1,2 VS 2013 (MVC 5.1)
6. What Is Wrong with ASP.NET Web Forms ?
Viewstate weight
Page life cycle
False sense of separation of concerns (SOC)
Limited control over HTML
Leaky abstraction
Low testability
9. ASP.NET MVC
ASP.NET MVC is a framework for building web applications that
applies the general Model
View Controller pattern to the ASP.NET framework
11. • ASP.NET MVC 1 Overview : at the Austin ALT.NET conference in October 2007 in Redmond ScottGu
showed a group of developers “this cool thing I wrote on a plane”- codenamed (Scalene)
• including code and unit tests
• Was released in March 2009
• ASP.NET MVC 2 Overview : was released just one year later, in March 2010
• UI helpers with automatic scaffolding with customizable templates
• Attribute-based model validation on both client and server
• Strongly typed HTML helpers
• Improved Visual Studio tooling
• ASP.NET MVC 3 Overview : shipped just 10 months after MVC 2
• The Razor view engine
• Support for .NET 4 Data Annotations
• Improved model validation
• Better JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding
• Use of NuGet to deliver software and manage dependencies throughout the platform
12. • Razor View Engine
Razor is the first major update to rendering HTML since ASP.NET 1 shipped almost a decade ago.
The default view engine used in MVC 1 and 2 was commonly called the Web Forms view engine
syntax in a Web Forms page is shown here :
13. Razor was designed specifically as a view engine syntax. It has one main focus: code-focused templating
for HTML generation. Here’s how that same markup would be generated using Razor:
ASP.NET MVC 3.0 Features
14. The Razor syntax is easier to type, and easier to read. Razor doesn’t have the XML-like heavy syntax
of the Web Forms view engine.
• Compact, expressive, and fluid
• Not a new language : Razor is a syntax that lets you use your existing .NET coding skills in a
template in a very intuitive way.
• Easy to learn: Precisely because Razor is not a new language, it’s easy to learn. You know
HTML, you know .NET; just type HTML and hit the @ sign whenever you need to write
some .NET code.
• Good IntelliSense
ASP.NET MVC 3.0 Features (cont.)
15. • Validation Improvements
Validation is an important part of building web applications, but it’s never fun. MVC 3 extended the
validation support to cover most scenarios you’re likely to encounter.
• .NET 4 Data Annotation Support :
• Unobtrusive JavaScript using data- instead of something like onclick,…
• jQuery Validation
• JSON Binding : enabling your action methods to accept and model-bind data in JSON format.
• Dependency Resolution : MVC 3 introduced a new concept called a dependency resolver, which greatly
simplified the use of dependency injection in your applications.
ASP.NET MVC 3.0 Features (cont.)
16. • MVC 4 Overview
• ASP.NET Web API : ASP.NET MVC development style but is tailored to writing HTTP services
• Enhancements to default project templates
• Mobile project template using jQuery Mobile
• Display Modes
• Task support for Asynchronous Controllers
• Bundling and minification
ASP.NET MVC 4
17. • Enhancements to Default Project Templates
MVC 1.0 MVC 4.0
ASP.NET MVC 4 (cont.)
18. • Mobile Project Template Using jQuery Mobile
Responsive jQuery Mobile
ASP.NET MVC 4 (cont.)
19. • Display Modes
Display modes use a convention-based approach to allow selecting different views based on the
browser making the request.
The default view engine first looks for views with names ending with .Mobile.cshtml when the
browser’s user agent indicates a known mobile device.
ASP.NET MVC 4 (cont.)
20. • Bundling and Minification
This system reduces requests to your site by combining several individual script references into a single
request.
ASP.NET MVC 4 (cont.)
22. • MVC 5 Overview
• One ASP.NET
• ASP.Net Identity
• Bootstrap 3.0 in the MVC template
• Authentication Filters
• Filter overrides
• Attribute routing (my Article here)
ASP.NET MVC 5
23. • Includes new cloud-optimized versions of MVC, Web API, Web Pages, SignalR, and
Entity Framework.
• MVC, Web API, and Web Pages will be merged into one framework, called MVC 6
• MVC 6 has no dependency on System.Web
• vNext uses the Rosyln compiler to compile code dynamically
• vNext is open source and cross platform
• vNext is host agnostic
A sneak peak or preview of ASP.NET vNext