SlideShare a Scribd company logo
Programming is Fun
With ASP.NET MVC!
Ian Carnaghan
Page  2
Programming is Fun with ASP.NET MVC
Introduction to ASP.NET
What is ASP.NET?
 ASP.NET is a development framework for
building web pages and web sites with
HTML, CSS, JavaScript and server
scripting.
 It was first released in January 2002 with
version 1.0 of the .NET Framework, and
is the successor to Microsoft's Active
Server Pages (ASP) technology.
 ASP.NET supports three different
development models:
Web Pages, MVC (Model View
Controller), and Web Forms.
Page  3
ASP.NET
Visual Studio 2012
Programming is Fun with ASP.NET MVC
The ASP.NET Framework
ASP.NET
Web
Forms
ASP.NET
MVC
ASP.NET
Web
Pages
Web Forms
View Engine
Razor View
Engine
WebMatrix
What is ASP.NET?
 Web Pages is the Simplest ASP.NET
model. Similar to PHP and classic ASP
with built-in templates and helpers for
database, video, graphics, social media
and more.
 MVC separates web applications into
different different components and
provides a lighter weight framework,
separation of concerns and DRY
approach to development.
 Webforms is the traditional ASP.NET
event driven development model. Web
pages with added server controls, server
events, and server code.
Page  4
Programming is Fun with ASP.NET MVC
IIS
SQL
Server
Entity
Framework
ASP.NET
JS &
JQuery
The Microsoft Web Platform
Internet Information Services
is the web server used by
ASP.NET applications.
EF is an Object Relational
Mapper (ORM) – the layer
that converts DB elements
such as tables and views to
objects uses in the
application.
ASP.NET MVC comes with
JavaScript libraries, jQuery
and HTML 5 support.
ASP.NET can use a range of
databases, however SQL Server
is the most popular has great
support in Visual Studio.
ASP.NET is the development
framework.
Page  5
Programming is Fun with ASP.NET MVC
Model View Controller
MVC
Model–view–controller (MVC) is a software
architecture pattern which separates the
representation of information from the user's
interaction with it. It was introduced by Trygve
Reenskaug at Xerox Parc in 1976.
 Model represents the data and business logic
such as database tables, constraints and
validations.
 View represent the screens the users access.
The view uses data from the model to provide
information to the user.
 Controller handles requests sent in by the user
and determines what actions need to be taken
by the application.
Page  6
Programming is Fun with ASP.NET MVC
Interactions Follow Natural Cycle:
1. User takes action
2. Application changes data model
3. Updated view sent to user
Different Technologies
MVC compatible with combining
other technologies into tiers
or layers.
Full Control over UI
New Razor View Engine provides
greater control and cleaner code.
No Viewstate requirement with auto-
generated code –100s Kb smaller.
Total control over requests sent
netween server and browser.
User Experience
HTML 5 Technologies, Non-Obtrusive JS,
Routing,. Maintainability
Modern coding Standards
Convention over configuration.
Similar to other popular MVC
Frameworks including Grails,
Ruby on Rails, Spring MVC,
Monorail and many others.
Maintainablility
DRY approach to programming
Testability
Since the UI is completely seperated
from the business logic, it is easier to unit
tests.
Multiple Unit testing framworks available.
Why Microsoft ASP.NET MVC?
Page  7
Programming is Fun with ASP.NET MVC
C:InetpubwwwrootWebsitePerson.aspx
http://www.website.com/Person.aspx?id=5
http://www.website.com/Person/5
Physical Location
ASP.NET Style
MVC Style
Routing
 Routing in MVC comes packages with easy to configure rules based on different circumstances.
 By default {ControllerName}/{MethodName}/(optional Id)
 Many URLs can link to the same controller via different methods
Page  8
Programming is Fun with ASP.NET MVC
Code First
 Preferred by programmers who do not want to work with designers and EDMX.
 Full control (no autogenerated code).
 Seperation from DB, regardless of technology. The ORM will handle creation.
 Manual changes to DB problematic and lost since code defines the database.
Database First
 Best choice if you already have DB designed by DBAs.
 ORM creates entities for you to use in your application.
 Manual changes to the database are possible - update model from database
Model First
 Preferred by people interested in building a site with least amount of coding.
 Use design tools – Partial loss of control on both entities and database
 Can be very productive for small easy projects.
 Manual changes to DB problematic and lost since model defines the database.
Architectural Options for Developing an Application
Page  9
Programming is Fun with ASP.NET MVC
Person Entity:
 Id (int)
 FirstName (string)
 LastName (string)
 BirthDate (datetime)
Context:
 People (Collection of Person)
 Using ASP.NET DbContext library
for Entity Framework
Person Model
 Index Method – Call existing
records from model to pass to a
list view
 Create Method – Provide empty
model to pass to a create view and
handle posts
 Edit Method – Call an existing
record via the model to pass to an
edit view and handle posts
 Details Page – Call an existing
record via the model to pass to a
display view
Person Controller
 Person/Index
 Person/Create
 PersonEdit
 Person/Details
Person Views
Simple CRUD (Create Read Update Delete) Application
The Object Relational Mapper enables communication between the application and database and
converts database elements into application-ready objects.
ASP.NET uses Entity Framework and a .Net Library called DbContext for this process.
DbContext enables you to query a database and group together changes that will then be written back
to the store as a unit.
Page  10
Programming is Fun with ASP.NET MVC
Simple CRUD (Create Read Update Delete) Application
Page  11
Programming is Fun with ASP.NET MVC
 Office of Population Affairs was a legacy ColdFusion
Application, which was redesigned using ASP.NET
and launched in April 2013.
 Application required versioning of records, logging,
approvals and extensive search.
 Twitter Bootstrap was used for the frontend layout
providing a responsive HTML 5 compliant design.
 Solr libraries integrated with ASP.NET via SolrNET.
 MVC 4 using Code First Entify Framework
Implementation with SQL Server and IIS.
Office of Population Affairs
Boot
strap
Apache Solr
ASP.NET MVC 4 & EF
Page  12
Programming is Fun with ASP.NET MVC
Domain Model
 Object representation of the physical database tables
 Validation and contraints are defined here and used throughout the
application
Repositories
 Heavy lifting work of performing all transactions needed from the
application layer to the database
 Mapping between Domain objects and View Model objects
Abstraction
Layer
 Interfaces the controllers can use to perform repository actions.
 Provides an additional layer of seperation – if major changes occur in
repository – the controllers are not dependent upon them.
View Models
 Subsets of the Domain Model, proving view specific information.
 Example public Organization Details only contains specific fields.
OPA Application Structure
Page  13
Programming is Fun with ASP.NET MVC
Community Health Online Resource Center
Ajax-based CDC Application
 Resource database of records
tagged in various categories.
 Full-text searching and AJAX front-
end for user interaction.
 Back-end administration for
managing resources and adding
users to maintain the database.
 Integration into CDC PIV Card
authentication via C# Active Directory
libraries.
Page  14
Programming is Fun with ASP.NET MVC
 National Diabetes Education Program
 Application will share code-base for the CHORC
 Records listing with thumbnails and integration with
NDEP API for adding resources to external cart.
 Monarch Academy web-based Curriculum Mapping.
 CM for Expeditionary Learning
 Maintainable by Administrators, Accessible by all
Teachers
 Based on Education Research
Future Projects
Page  15
Programming is Fun with ASP.NET MVC
 http://www.pluralsight.com
 Pluralsight is by and far the
best Microsoft Development
Training Site!
 ICF may pay for the yearly
subscription via Training or
Tuition Reimbursement
 Check out Julie Lerman
 http://www.apress.com/97814
30242369
 Work through the Sports
Store tutorial!
 Great indepth explanations
 Keep as good reference
guide
 http://www.hanselman.com
 Check out his other videos at
various conferences
 Subscribe to Hanselminutes
Podcasts
 Also check out .Net Rocks!
Learning Resources for ASP.NET MVC 4
* Oh and did I mention Stackoverflow!?
Page  16
Do You Have
Any Questions?

More Related Content

PPTX
Drupal Site Building for Developers
DOCX
Top 10 Javascript Frameworks For Easy Web Development
PDF
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
PPT
Top 10 web application development frameworks 2016
PPTX
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
PPT
Ruby on Rails: Building Web Applications Is Fun Again!
PPTX
Introduction to MVC Web Framework with CodeIgniter
PPTX
SharePoint Framework - Developer Preview
Drupal Site Building for Developers
Top 10 Javascript Frameworks For Easy Web Development
Web Application Frameworks - Lecture 05 - Web Information Systems (4011474FNR)
Top 10 web application development frameworks 2016
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Ruby on Rails: Building Web Applications Is Fun Again!
Introduction to MVC Web Framework with CodeIgniter
SharePoint Framework - Developer Preview

What's hot (20)

PDF
SPCA2013 - Building Windows Client Applications for SharePoint 2013
PPTX
Chris O'Brien - Introduction to the SharePoint Framework for developers
PDF
Industry-Standard Web Development Techniques for Angular
PPTX
Frameworks Galore: A Pragmatic Review
PDF
CodeIgniter - PHP MVC Framework by silicongulf.com
PDF
Come riprogettare le attuali farm solution di share point con il nuovo modell...
PDF
Spring Mvc
PPTX
SharePoint development 2017 wrap-up
PDF
Power Apps Advanced Training Brochure
PPTX
Parallel minds silverlight
PDF
SharePoint 2010 and Colligo for ECM
PPTX
Application innovation & Developer Productivity
PPTX
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
PDF
A Gentle introduction to Web Development & Django
PDF
Sense/Net 6.0 product
PDF
DevOps lagos meetup
PDF
Making Of PHP Based Web Application
PPT
Training on webwroks1
PDF
Sybase sup hybrid_web_container_article_wp
PPTX
RIA - Rich Internet Applications
SPCA2013 - Building Windows Client Applications for SharePoint 2013
Chris O'Brien - Introduction to the SharePoint Framework for developers
Industry-Standard Web Development Techniques for Angular
Frameworks Galore: A Pragmatic Review
CodeIgniter - PHP MVC Framework by silicongulf.com
Come riprogettare le attuali farm solution di share point con il nuovo modell...
Spring Mvc
SharePoint development 2017 wrap-up
Power Apps Advanced Training Brochure
Parallel minds silverlight
SharePoint 2010 and Colligo for ECM
Application innovation & Developer Productivity
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
A Gentle introduction to Web Development & Django
Sense/Net 6.0 product
DevOps lagos meetup
Making Of PHP Based Web Application
Training on webwroks1
Sybase sup hybrid_web_container_article_wp
RIA - Rich Internet Applications
Ad

Similar to Programming is Fun with ASP.NET MVC (20)

PPTX
Asp.Net Core MVC with Entity Framework
PPTX
ASP.NET Presentation
PDF
A Deep Dive into Android App Development 2.0.pdf
PPTX
Asp.netmvc handson
PPTX
Spring tutorials
PDF
Avigma Tech LLC- Why the MVC pattern so popular?
PPTX
An overview of microsoft mvc dot net
PPTX
Asp.net mvc 5 course module 1 overview
PPTX
ASP.NET MVC Fundamental
PDF
A Brief Note On Asp.Net And Cloud Computing Essay
PDF
Getting Started with Spring Framework
PDF
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
PPT
ASP.NET MVC - In the Wild
PPTX
Mvc3 part1
PDF
ASP.NET MVC Introduction
PDF
Murach: An introduction to web programming with ASP.NET Core MVC
PPTX
MVC - Introduction
PDF
MVC Interview Questions PDF By ScholarHat
DOCX
Sanjeev_Kumar_Paul- Resume-Latest
DOC
Asp.Net Core MVC with Entity Framework
ASP.NET Presentation
A Deep Dive into Android App Development 2.0.pdf
Asp.netmvc handson
Spring tutorials
Avigma Tech LLC- Why the MVC pattern so popular?
An overview of microsoft mvc dot net
Asp.net mvc 5 course module 1 overview
ASP.NET MVC Fundamental
A Brief Note On Asp.Net And Cloud Computing Essay
Getting Started with Spring Framework
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
ASP.NET MVC - In the Wild
Mvc3 part1
ASP.NET MVC Introduction
Murach: An introduction to web programming with ASP.NET Core MVC
MVC - Introduction
MVC Interview Questions PDF By ScholarHat
Sanjeev_Kumar_Paul- Resume-Latest
Ad

More from Ian Carnaghan (14)

PPTX
Standardizing Drupal Development Environments using Containers
PPTX
Drupal Theming for Developers
PDF
Doctoral Defense
PPTX
Exploratory Eye Tracking Research with Curriculum Mapping
PPTX
Drupal at ICF International
PPTX
Curriculum Mapping
PPTX
Information Culture Wrapup
PPTX
Usability
PPTX
Future Careers
PPTX
Motion Graphics
PPTX
Gamification
PPTX
PPTX
History of Online Education
PPTX
Social Media
Standardizing Drupal Development Environments using Containers
Drupal Theming for Developers
Doctoral Defense
Exploratory Eye Tracking Research with Curriculum Mapping
Drupal at ICF International
Curriculum Mapping
Information Culture Wrapup
Usability
Future Careers
Motion Graphics
Gamification
History of Online Education
Social Media

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
System and Network Administration Chapter 2
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
Transform Your Business with a Software ERP System
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
AI in Product Development-omnex systems
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Design an Analysis of Algorithms II-SECS-1021-03
medical staffing services at VALiNTRY
wealthsignaloriginal-com-DS-text-... (1).pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
System and Network Administration Chapter 2
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Internet Downloader Manager (IDM) Crack 6.42 Build 41
How to Migrate SBCGlobal Email to Yahoo Easily
Operating system designcfffgfgggggggvggggggggg
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Wondershare Filmora 15 Crack With Activation Key [2025
CHAPTER 2 - PM Management and IT Context
Odoo POS Development Services by CandidRoot Solutions
Transform Your Business with a Software ERP System
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
AI in Product Development-omnex systems
Which alternative to Crystal Reports is best for small or large businesses.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Design an Analysis of Algorithms II-SECS-1021-03

Programming is Fun with ASP.NET MVC

  • 1. Programming is Fun With ASP.NET MVC! Ian Carnaghan
  • 2. Page  2 Programming is Fun with ASP.NET MVC Introduction to ASP.NET What is ASP.NET?  ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting.  It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology.  ASP.NET supports three different development models: Web Pages, MVC (Model View Controller), and Web Forms.
  • 3. Page  3 ASP.NET Visual Studio 2012 Programming is Fun with ASP.NET MVC The ASP.NET Framework ASP.NET Web Forms ASP.NET MVC ASP.NET Web Pages Web Forms View Engine Razor View Engine WebMatrix What is ASP.NET?  Web Pages is the Simplest ASP.NET model. Similar to PHP and classic ASP with built-in templates and helpers for database, video, graphics, social media and more.  MVC separates web applications into different different components and provides a lighter weight framework, separation of concerns and DRY approach to development.  Webforms is the traditional ASP.NET event driven development model. Web pages with added server controls, server events, and server code.
  • 4. Page  4 Programming is Fun with ASP.NET MVC IIS SQL Server Entity Framework ASP.NET JS & JQuery The Microsoft Web Platform Internet Information Services is the web server used by ASP.NET applications. EF is an Object Relational Mapper (ORM) – the layer that converts DB elements such as tables and views to objects uses in the application. ASP.NET MVC comes with JavaScript libraries, jQuery and HTML 5 support. ASP.NET can use a range of databases, however SQL Server is the most popular has great support in Visual Studio. ASP.NET is the development framework.
  • 5. Page  5 Programming is Fun with ASP.NET MVC Model View Controller MVC Model–view–controller (MVC) is a software architecture pattern which separates the representation of information from the user's interaction with it. It was introduced by Trygve Reenskaug at Xerox Parc in 1976.  Model represents the data and business logic such as database tables, constraints and validations.  View represent the screens the users access. The view uses data from the model to provide information to the user.  Controller handles requests sent in by the user and determines what actions need to be taken by the application.
  • 6. Page  6 Programming is Fun with ASP.NET MVC Interactions Follow Natural Cycle: 1. User takes action 2. Application changes data model 3. Updated view sent to user Different Technologies MVC compatible with combining other technologies into tiers or layers. Full Control over UI New Razor View Engine provides greater control and cleaner code. No Viewstate requirement with auto- generated code –100s Kb smaller. Total control over requests sent netween server and browser. User Experience HTML 5 Technologies, Non-Obtrusive JS, Routing,. Maintainability Modern coding Standards Convention over configuration. Similar to other popular MVC Frameworks including Grails, Ruby on Rails, Spring MVC, Monorail and many others. Maintainablility DRY approach to programming Testability Since the UI is completely seperated from the business logic, it is easier to unit tests. Multiple Unit testing framworks available. Why Microsoft ASP.NET MVC?
  • 7. Page  7 Programming is Fun with ASP.NET MVC C:InetpubwwwrootWebsitePerson.aspx http://www.website.com/Person.aspx?id=5 http://www.website.com/Person/5 Physical Location ASP.NET Style MVC Style Routing  Routing in MVC comes packages with easy to configure rules based on different circumstances.  By default {ControllerName}/{MethodName}/(optional Id)  Many URLs can link to the same controller via different methods
  • 8. Page  8 Programming is Fun with ASP.NET MVC Code First  Preferred by programmers who do not want to work with designers and EDMX.  Full control (no autogenerated code).  Seperation from DB, regardless of technology. The ORM will handle creation.  Manual changes to DB problematic and lost since code defines the database. Database First  Best choice if you already have DB designed by DBAs.  ORM creates entities for you to use in your application.  Manual changes to the database are possible - update model from database Model First  Preferred by people interested in building a site with least amount of coding.  Use design tools – Partial loss of control on both entities and database  Can be very productive for small easy projects.  Manual changes to DB problematic and lost since model defines the database. Architectural Options for Developing an Application
  • 9. Page  9 Programming is Fun with ASP.NET MVC Person Entity:  Id (int)  FirstName (string)  LastName (string)  BirthDate (datetime) Context:  People (Collection of Person)  Using ASP.NET DbContext library for Entity Framework Person Model  Index Method – Call existing records from model to pass to a list view  Create Method – Provide empty model to pass to a create view and handle posts  Edit Method – Call an existing record via the model to pass to an edit view and handle posts  Details Page – Call an existing record via the model to pass to a display view Person Controller  Person/Index  Person/Create  PersonEdit  Person/Details Person Views Simple CRUD (Create Read Update Delete) Application The Object Relational Mapper enables communication between the application and database and converts database elements into application-ready objects. ASP.NET uses Entity Framework and a .Net Library called DbContext for this process. DbContext enables you to query a database and group together changes that will then be written back to the store as a unit.
  • 10. Page  10 Programming is Fun with ASP.NET MVC Simple CRUD (Create Read Update Delete) Application
  • 11. Page  11 Programming is Fun with ASP.NET MVC  Office of Population Affairs was a legacy ColdFusion Application, which was redesigned using ASP.NET and launched in April 2013.  Application required versioning of records, logging, approvals and extensive search.  Twitter Bootstrap was used for the frontend layout providing a responsive HTML 5 compliant design.  Solr libraries integrated with ASP.NET via SolrNET.  MVC 4 using Code First Entify Framework Implementation with SQL Server and IIS. Office of Population Affairs Boot strap Apache Solr ASP.NET MVC 4 & EF
  • 12. Page  12 Programming is Fun with ASP.NET MVC Domain Model  Object representation of the physical database tables  Validation and contraints are defined here and used throughout the application Repositories  Heavy lifting work of performing all transactions needed from the application layer to the database  Mapping between Domain objects and View Model objects Abstraction Layer  Interfaces the controllers can use to perform repository actions.  Provides an additional layer of seperation – if major changes occur in repository – the controllers are not dependent upon them. View Models  Subsets of the Domain Model, proving view specific information.  Example public Organization Details only contains specific fields. OPA Application Structure
  • 13. Page  13 Programming is Fun with ASP.NET MVC Community Health Online Resource Center Ajax-based CDC Application  Resource database of records tagged in various categories.  Full-text searching and AJAX front- end for user interaction.  Back-end administration for managing resources and adding users to maintain the database.  Integration into CDC PIV Card authentication via C# Active Directory libraries.
  • 14. Page  14 Programming is Fun with ASP.NET MVC  National Diabetes Education Program  Application will share code-base for the CHORC  Records listing with thumbnails and integration with NDEP API for adding resources to external cart.  Monarch Academy web-based Curriculum Mapping.  CM for Expeditionary Learning  Maintainable by Administrators, Accessible by all Teachers  Based on Education Research Future Projects
  • 15. Page  15 Programming is Fun with ASP.NET MVC  http://www.pluralsight.com  Pluralsight is by and far the best Microsoft Development Training Site!  ICF may pay for the yearly subscription via Training or Tuition Reimbursement  Check out Julie Lerman  http://www.apress.com/97814 30242369  Work through the Sports Store tutorial!  Great indepth explanations  Keep as good reference guide  http://www.hanselman.com  Check out his other videos at various conferences  Subscribe to Hanselminutes Podcasts  Also check out .Net Rocks! Learning Resources for ASP.NET MVC 4 * Oh and did I mention Stackoverflow!?
  • 16. Page  16 Do You Have Any Questions?