SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Head First ASP.Net MVC 2.0

                 Zhiming Jiang
            MSN GMD Integration
TOPIC
•   Review
•   Getting started with ASP.NET MVC
•   Understanding ASP.NET MVC
•   Customizing and Extending
•   Best Practices
•   MVC 2.0 New Features
The way of ASP.NET MVC

REVIEW
The Downside of ASP.NET
• Very complex page pipeline engine
• Difficult to maintain
• Impossible to test
   – Difficulty partially arises from simulating
     Context, Request, Response, and Session objects.
• The cryptic control ids and sensitivities of ViewState
• Overly mix business and presentation logic
• Event-driven model
Innovation!
MVC Framework
                          History
1970S




        2003 RoR




                   Based on Python
                                     ….   2009.3 MVC1

                                          2010.4 MVC2
ASP.NET MVC IS……
• New ASP.NET application development style
    – Another is“ASP.NET Web Form”
    – Fill the gaps of ASP.NET Web Form
•   New choice
•   Full control over URLs
•   Full control over HTML
•   Easier to test (TDD)
•   Flexible, extendable, easily replaced
ASP.NET MVC IS NOT……

• The substitute of 3-tier structure
• ASP.NET Web Form’s substitute
• ASP.NET Web Form promotion version
  – ASP.NET Web Form 4.0
• Fit RAD
• Fit every project
• Fit everyone
Different Between with Web Form

  Classic Web Form              ASP.NET MVC

           Postback              REST, HTML Post

         Code behind            Separate controller

          Single form             Multiple forms


        Server controls           HTML Helpers

   Page and control lifecycle       Controller
ASP.NET MVC 101

GETTING STARTED WITH ASP.NET
MVC
ASP.NET MVC Framework Structure

                                       ASP.NET Abstractions
                                   (System.Web.Abstractions.dll)




          ASP.NET Routing
      (System.Web.Routing.dll)




                                     ASP.NET MVC
                                 (System.Web.Mvc.dll)
But what is the work process?
但是具体的流程是什么样?
Classic Application Architecture

                      MvcDemo.Web.UI

Presentatio




                                             MvcDemo.Models
n                  MvcDemo.Web.Controllers



Biz                   MvcDemo.Business
Service


DataAccess             MvcDemo.Data
Responsity
ASP.NET MVC Excute Process
Understanding Models, Views, and Controllers

UNDERSTANDING ASP.NET MVC
ASP.NET Routing
•   URL Patterns
•   Setting Default Values for URL Parameters
•   Adding Constraints to Routes
•   Scenarios When Routing Is Not Applied
•   How URLs Are Matched to Routes
•   Accessing URL Parameters in a Routed Page
•   ASP.NET Routing and Security
•   ASP.NET Routing versus URL Rewriting
Working with Models

• What’s Model




• Validation
Controllers & Action
• Receiving input
  – QueryString, Request.Form, FormCollection, Custome(IModelBinding)

• Filter
• Aysnc action
• Producing output
  – Action Result, View Data, View Model

• How defines
  – End with the word Controller
  – Inherit from System.Web.Mvc.Controller (or implement Icontroller
  – Contain public methods that return ActionResult
Filtering Action Methods
Working with Views

•   View Engine
•   View Page
•   View Data
•   View Helper
•   Form Post
•   Using MasterPage
•   Order
MVC Custom and Extensions

CUSTOMIZING AND EXTENDING
Customizing & Extending

•   Extending URL Routing
•   Customer ControllerFactory
•   Extending Controller & Action
•   Custom View Engine
•   T4 Template
Truth in Practice

BEST PRACTICES
Best Practices
 Securing MVC applications
 Dependency Injection of Controllers
 Using RESTful Architecture
 Handling errors in MVC applications
 Unit Test & MVC Mock Helpers
 Using AJAX in ASP.NET MVC applications
 Improving ASP.NET MVC application performance
 Localizing ASP.NET MVC Validation
 Deploying MVC applications
Areas, Async Controllers Support, Scaffold …

MVC 2.0 NEW FEATURES
• New Strongly Typed HTML Helpers
• Enhanced Model Validation support across both server and
 client
• Auto-Scaffold UI Helpers with Template Customization
• Support for splitting up large applications into “Areas”
• Asynchronous Controllers support that enables long
 running tasks in parallel
• Support for rendering sub-sections of a page/site using
 Html.RenderAction
• Lots of new helper functions, utilities, and API
 enhancements
• Improved Visual Studio tooling support
Areas

• Introduction
  – Organizing our projects hierarchically into folders
    and namespaces
• Building a portable area
• Embedding Views
• Distributing a portable area
Async Controllers Support

•   Change the way of request handling
•   Decide whether the action is async or not
•   Execute an action
•   ModelBinder support
•   Limitations and drawbacks
http://nerddinner.codeplex.com/
                             [Video]Creating NerdDinner.com with MVC

                             Oxite 2: An official CMS Product
                             MvcContrib: a Codeplex Foundation Project
                             http://mvccontrib.codeplex.com/
                             http://tailspintravel.codeplex.com
                             http://mvcsitemap.codeplex.com/
                             http://mvcmembership.codeplex.com/
                             http://code.msdn.microsoft.com/aspnetmvcsamples
Nice projects to learn MVC

RECOURSE
Please fill out the session evaluation form
                              provided and drop it off with the staff at the exit.


Your Feedback is Important!

IT IS OVER,THANKS

Weitere ähnliche Inhalte

Was ist angesagt?

EWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIsEWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIsRob Tweed
 
Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015Fastly
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Luciano Mammino
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 WorkflowsRyan Street
 
vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습John Kim
 
007. Redux middlewares
007. Redux middlewares007. Redux middlewares
007. Redux middlewaresBinh Quan Duc
 
EWD 3 Training Course Part 3: Summary of EWD 3 Modules
EWD 3 Training Course Part 3: Summary of EWD 3 ModulesEWD 3 Training Course Part 3: Summary of EWD 3 Modules
EWD 3 Training Course Part 3: Summary of EWD 3 ModulesRob Tweed
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務Mu Chun Wang
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleHenryk Konsek
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
EWD 3 Training Course Part 26: Event-driven Indexing
EWD 3 Training Course Part 26: Event-driven IndexingEWD 3 Training Course Part 26: Event-driven Indexing
EWD 3 Training Course Part 26: Event-driven IndexingRob Tweed
 
Nomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweightsNomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweightsIago López Galeiras
 
ApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache KarafApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache KarafAchim Nierbeck
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...All Things Open
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneidermfrancis
 
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다Arawn Park
 
Advanced VCL: how to use restart
Advanced VCL: how to use restartAdvanced VCL: how to use restart
Advanced VCL: how to use restartFastly
 
006. React - Redux framework
006. React - Redux framework006. React - Redux framework
006. React - Redux frameworkBinh Quan Duc
 
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...Rob Tweed
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 

Was ist angesagt? (20)

EWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIsEWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIs
 
Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습
 
007. Redux middlewares
007. Redux middlewares007. Redux middlewares
007. Redux middlewares
 
EWD 3 Training Course Part 3: Summary of EWD 3 Modules
EWD 3 Training Course Part 3: Summary of EWD 3 ModulesEWD 3 Training Course Part 3: Summary of EWD 3 Modules
EWD 3 Training Course Part 3: Summary of EWD 3 Modules
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whale
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
EWD 3 Training Course Part 26: Event-driven Indexing
EWD 3 Training Course Part 26: Event-driven IndexingEWD 3 Training Course Part 26: Event-driven Indexing
EWD 3 Training Course Part 26: Event-driven Indexing
 
Nomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweightsNomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweights
 
ApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache KarafApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache Karaf
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
 
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
잘 키운 모노리스 하나 열 마이크로서비스 안 부럽다
 
Advanced VCL: how to use restart
Advanced VCL: how to use restartAdvanced VCL: how to use restart
Advanced VCL: how to use restart
 
006. React - Redux framework
006. React - Redux framework006. React - Redux framework
006. React - Redux framework
 
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 

Andere mochten auch

Real time app with SignalR
Real time app with SignalR Real time app with SignalR
Real time app with SignalR Mojammel Haque
 
Benefits of using angular js
Benefits of using angular jsBenefits of using angular js
Benefits of using angular jsManev Dave
 
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1Gaurav Arora
 
Aspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalAspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalCredera
 
Asp Net (FT Preasen Revankar)
Asp Net   (FT  Preasen Revankar)Asp Net   (FT  Preasen Revankar)
Asp Net (FT Preasen Revankar)Fafadia Tech
 
Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)Fafadia Tech
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NETAlessandro Giorgetti
 
SignalR With ASP.Net part1
SignalR With ASP.Net part1SignalR With ASP.Net part1
SignalR With ASP.Net part1Esraa Ammar
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSArmin Vieweg
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC PresentationVolkan Uzun
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCKhaled Musaied
 
AngularJS performance & production tips
AngularJS performance & production tipsAngularJS performance & production tips
AngularJS performance & production tipsNir Kaufman
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)Gary Arora
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS FrameworkRaveendra R
 

Andere mochten auch (20)

AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
Real time app with SignalR
Real time app with SignalR Real time app with SignalR
Real time app with SignalR
 
Benefits of using angular js
Benefits of using angular jsBenefits of using angular js
Benefits of using angular js
 
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1
 
Aspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalAspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_final
 
Asp Net (FT Preasen Revankar)
Asp Net   (FT  Preasen Revankar)Asp Net   (FT  Preasen Revankar)
Asp Net (FT Preasen Revankar)
 
Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET
 
SignalR With ASP.Net part1
SignalR With ASP.Net part1SignalR With ASP.Net part1
SignalR With ASP.Net part1
 
Benefits of developing a Single Page Web Applications using AngularJS
Benefits of developing a Single Page Web Applications using AngularJSBenefits of developing a Single Page Web Applications using AngularJS
Benefits of developing a Single Page Web Applications using AngularJS
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
 
SignalR
SignalRSignalR
SignalR
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
SignalR
SignalRSignalR
SignalR
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
AngularJS performance & production tips
AngularJS performance & production tipsAngularJS performance & production tips
AngularJS performance & production tips
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS Framework
 

Ähnlich wie Aspnet mvc

Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttLanvige Jiang
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesAaron Jacobson
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architectureravindraquicsolv
 
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Dot Net Tricks
 
What is ASP.NET MVC
What is ASP.NET MVCWhat is ASP.NET MVC
What is ASP.NET MVCBrad Oyler
 
ASP.NET MVC4 Overview
ASP.NET MVC4 OverviewASP.NET MVC4 Overview
ASP.NET MVC4 OverviewMahmoud Tolba
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Mayank Srivastava
 
ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemSaBin SaleEm
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCAnkit Kashyap
 
Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantnonlinear creations
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCSirwan Afifi
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8Thomas Robbins
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part IRohit Rao
 

Ähnlich wie Aspnet mvc (20)

Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
 
Asp 1a-aspnetmvc
Asp 1a-aspnetmvcAsp 1a-aspnetmvc
Asp 1a-aspnetmvc
 
Aspnetmvc 1
Aspnetmvc 1Aspnetmvc 1
Aspnetmvc 1
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
What is ASP.NET MVC
What is ASP.NET MVCWhat is ASP.NET MVC
What is ASP.NET MVC
 
ASP.NET MVC4 Overview
ASP.NET MVC4 OverviewASP.NET MVC4 Overview
ASP.NET MVC4 Overview
 
ASP.NET MVC overview
ASP.NET MVC overviewASP.NET MVC overview
ASP.NET MVC overview
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
 
ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin Saleem
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
 
Mvc
MvcMvc
Mvc
 
Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's important
 
Sitecore mvc
Sitecore mvcSitecore mvc
Sitecore mvc
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
 

Mehr von Hiep Luong

Youth in Community at Youth for Cause Dialogue Session 10 June 2011
Youth in Community  at Youth for Cause Dialogue Session 10 June 2011Youth in Community  at Youth for Cause Dialogue Session 10 June 2011
Youth in Community at Youth for Cause Dialogue Session 10 June 2011Hiep Luong
 
Lin at youth for cause dialogue session 10 june 2011
Lin at youth for cause dialogue session 10 june 2011Lin at youth for cause dialogue session 10 june 2011
Lin at youth for cause dialogue session 10 june 2011Hiep Luong
 
Gop Sang at Youth for Cause Dialogue Session 10 June 2011
Gop Sang at Youth for Cause Dialogue Session 10 June 2011Gop Sang at Youth for Cause Dialogue Session 10 June 2011
Gop Sang at Youth for Cause Dialogue Session 10 June 2011Hiep Luong
 
Gop sang at youth for cause dialogue session 10 june 2011
Gop sang  at youth for cause dialogue session 10 june 2011Gop sang  at youth for cause dialogue session 10 june 2011
Gop sang at youth for cause dialogue session 10 june 2011Hiep Luong
 
Eco profile at youth for cause dialogue session 10 june 2011
Eco profile at youth for cause dialogue session 10 june 2011Eco profile at youth for cause dialogue session 10 june 2011
Eco profile at youth for cause dialogue session 10 june 2011Hiep Luong
 
Be a guardian evg at youth for cause dialogue session 10 june 2011
Be a guardian   evg at youth for cause dialogue session 10 june 2011Be a guardian   evg at youth for cause dialogue session 10 june 2011
Be a guardian evg at youth for cause dialogue session 10 june 2011Hiep Luong
 
Touch group at youth for cause dialogue session 10 june 2011
Touch group at youth for cause dialogue session 10 june 2011Touch group at youth for cause dialogue session 10 june 2011
Touch group at youth for cause dialogue session 10 june 2011Hiep Luong
 
Structured teaching
Structured teachingStructured teaching
Structured teachingHiep Luong
 
S211 conference pr presentation jg master
S211 conference pr presentation jg masterS211 conference pr presentation jg master
S211 conference pr presentation jg masterHiep Luong
 
Presentation Layer
Presentation LayerPresentation Layer
Presentation LayerHiep Luong
 
Cryptography and E-Commerce
Cryptography and E-CommerceCryptography and E-Commerce
Cryptography and E-CommerceHiep Luong
 
Defining business process and workflows
Defining business process and workflowsDefining business process and workflows
Defining business process and workflowsHiep Luong
 
ECM Introduction
ECM IntroductionECM Introduction
ECM IntroductionHiep Luong
 
Business Intelligence
Business IntelligenceBusiness Intelligence
Business IntelligenceHiep Luong
 
Search overview
Search overviewSearch overview
Search overviewHiep Luong
 
Communication Training
Communication TrainingCommunication Training
Communication TrainingHiep Luong
 

Mehr von Hiep Luong (20)

Youth in Community at Youth for Cause Dialogue Session 10 June 2011
Youth in Community  at Youth for Cause Dialogue Session 10 June 2011Youth in Community  at Youth for Cause Dialogue Session 10 June 2011
Youth in Community at Youth for Cause Dialogue Session 10 June 2011
 
Lin at youth for cause dialogue session 10 june 2011
Lin at youth for cause dialogue session 10 june 2011Lin at youth for cause dialogue session 10 june 2011
Lin at youth for cause dialogue session 10 june 2011
 
Gop Sang at Youth for Cause Dialogue Session 10 June 2011
Gop Sang at Youth for Cause Dialogue Session 10 June 2011Gop Sang at Youth for Cause Dialogue Session 10 June 2011
Gop Sang at Youth for Cause Dialogue Session 10 June 2011
 
Gop sang at youth for cause dialogue session 10 june 2011
Gop sang  at youth for cause dialogue session 10 june 2011Gop sang  at youth for cause dialogue session 10 june 2011
Gop sang at youth for cause dialogue session 10 june 2011
 
Eco profile at youth for cause dialogue session 10 june 2011
Eco profile at youth for cause dialogue session 10 june 2011Eco profile at youth for cause dialogue session 10 june 2011
Eco profile at youth for cause dialogue session 10 june 2011
 
Be a guardian evg at youth for cause dialogue session 10 june 2011
Be a guardian   evg at youth for cause dialogue session 10 june 2011Be a guardian   evg at youth for cause dialogue session 10 june 2011
Be a guardian evg at youth for cause dialogue session 10 june 2011
 
Touch group at youth for cause dialogue session 10 june 2011
Touch group at youth for cause dialogue session 10 june 2011Touch group at youth for cause dialogue session 10 june 2011
Touch group at youth for cause dialogue session 10 june 2011
 
Structured teaching
Structured teachingStructured teaching
Structured teaching
 
SSL
SSLSSL
SSL
 
S211 conference pr presentation jg master
S211 conference pr presentation jg masterS211 conference pr presentation jg master
S211 conference pr presentation jg master
 
Presentation Layer
Presentation LayerPresentation Layer
Presentation Layer
 
E-Commerce
E-CommerceE-Commerce
E-Commerce
 
Cryptography and E-Commerce
Cryptography and E-CommerceCryptography and E-Commerce
Cryptography and E-Commerce
 
Ptit tmdt
Ptit   tmdtPtit   tmdt
Ptit tmdt
 
Defining business process and workflows
Defining business process and workflowsDefining business process and workflows
Defining business process and workflows
 
ECM Introduction
ECM IntroductionECM Introduction
ECM Introduction
 
Collaboration
CollaborationCollaboration
Collaboration
 
Business Intelligence
Business IntelligenceBusiness Intelligence
Business Intelligence
 
Search overview
Search overviewSearch overview
Search overview
 
Communication Training
Communication TrainingCommunication Training
Communication Training
 

Kürzlich hochgeladen

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Aspnet mvc

  • 1. Head First ASP.Net MVC 2.0 Zhiming Jiang MSN GMD Integration
  • 2. TOPIC • Review • Getting started with ASP.NET MVC • Understanding ASP.NET MVC • Customizing and Extending • Best Practices • MVC 2.0 New Features
  • 3. The way of ASP.NET MVC REVIEW
  • 4. The Downside of ASP.NET • Very complex page pipeline engine • Difficult to maintain • Impossible to test – Difficulty partially arises from simulating Context, Request, Response, and Session objects. • The cryptic control ids and sensitivities of ViewState • Overly mix business and presentation logic • Event-driven model
  • 6. MVC Framework History 1970S 2003 RoR Based on Python …. 2009.3 MVC1 2010.4 MVC2
  • 7. ASP.NET MVC IS…… • New ASP.NET application development style – Another is“ASP.NET Web Form” – Fill the gaps of ASP.NET Web Form • New choice • Full control over URLs • Full control over HTML • Easier to test (TDD) • Flexible, extendable, easily replaced
  • 8. ASP.NET MVC IS NOT…… • The substitute of 3-tier structure • ASP.NET Web Form’s substitute • ASP.NET Web Form promotion version – ASP.NET Web Form 4.0 • Fit RAD • Fit every project • Fit everyone
  • 9. Different Between with Web Form Classic Web Form ASP.NET MVC Postback REST, HTML Post Code behind Separate controller Single form Multiple forms Server controls HTML Helpers Page and control lifecycle Controller
  • 10. ASP.NET MVC 101 GETTING STARTED WITH ASP.NET MVC
  • 11. ASP.NET MVC Framework Structure ASP.NET Abstractions (System.Web.Abstractions.dll) ASP.NET Routing (System.Web.Routing.dll) ASP.NET MVC (System.Web.Mvc.dll)
  • 12. But what is the work process? 但是具体的流程是什么样?
  • 13. Classic Application Architecture MvcDemo.Web.UI Presentatio MvcDemo.Models n MvcDemo.Web.Controllers Biz MvcDemo.Business Service DataAccess MvcDemo.Data Responsity
  • 15. Understanding Models, Views, and Controllers UNDERSTANDING ASP.NET MVC
  • 16. ASP.NET Routing • URL Patterns • Setting Default Values for URL Parameters • Adding Constraints to Routes • Scenarios When Routing Is Not Applied • How URLs Are Matched to Routes • Accessing URL Parameters in a Routed Page • ASP.NET Routing and Security • ASP.NET Routing versus URL Rewriting
  • 17. Working with Models • What’s Model • Validation
  • 18. Controllers & Action • Receiving input – QueryString, Request.Form, FormCollection, Custome(IModelBinding) • Filter • Aysnc action • Producing output – Action Result, View Data, View Model • How defines – End with the word Controller – Inherit from System.Web.Mvc.Controller (or implement Icontroller – Contain public methods that return ActionResult
  • 20. Working with Views • View Engine • View Page • View Data • View Helper • Form Post • Using MasterPage • Order
  • 21. MVC Custom and Extensions CUSTOMIZING AND EXTENDING
  • 22. Customizing & Extending • Extending URL Routing • Customer ControllerFactory • Extending Controller & Action • Custom View Engine • T4 Template
  • 24. Best Practices  Securing MVC applications  Dependency Injection of Controllers  Using RESTful Architecture  Handling errors in MVC applications  Unit Test & MVC Mock Helpers  Using AJAX in ASP.NET MVC applications  Improving ASP.NET MVC application performance  Localizing ASP.NET MVC Validation  Deploying MVC applications
  • 25. Areas, Async Controllers Support, Scaffold … MVC 2.0 NEW FEATURES
  • 26. • New Strongly Typed HTML Helpers • Enhanced Model Validation support across both server and client • Auto-Scaffold UI Helpers with Template Customization • Support for splitting up large applications into “Areas” • Asynchronous Controllers support that enables long running tasks in parallel • Support for rendering sub-sections of a page/site using Html.RenderAction • Lots of new helper functions, utilities, and API enhancements • Improved Visual Studio tooling support
  • 27. Areas • Introduction – Organizing our projects hierarchically into folders and namespaces • Building a portable area • Embedding Views • Distributing a portable area
  • 28. Async Controllers Support • Change the way of request handling • Decide whether the action is async or not • Execute an action • ModelBinder support • Limitations and drawbacks
  • 29. http://nerddinner.codeplex.com/ [Video]Creating NerdDinner.com with MVC Oxite 2: An official CMS Product MvcContrib: a Codeplex Foundation Project http://mvccontrib.codeplex.com/ http://tailspintravel.codeplex.com http://mvcsitemap.codeplex.com/ http://mvcmembership.codeplex.com/ http://code.msdn.microsoft.com/aspnetmvcsamples Nice projects to learn MVC RECOURSE
  • 30. Please fill out the session evaluation form provided and drop it off with the staff at the exit. Your Feedback is Important! IT IS OVER,THANKS