SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Introduction to ASP.NET MVC
Agenda ,[object Object],[object Object],[object Object],[object Object]
What's MVC View Model Controller ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What's ASP.NET MVC ,[object Object],ASP.NET   Web Form ASP.NET MVC Core standard ASP . NET engine Microsoft .NET Framework
Goals of ASP.NET MVC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ASP.NET MVC ,[object Object],[object Object]
ASP.NET MVC ,[object Object],[object Object],[object Object],[object Object]
Demo: Hello World
[object Object],[object Object],How does it work? Action in controller Controller http://localhost:1725/ Hello / ActionTest
[object Object],[object Object],Routing public static void RegisterRoutes(RouteCollection routes) {   routes.MapRoute( "Default",  "{ controller }/{ action }/{ id }",  new { controller = "Home", action = "Index", id = "" } ); } http://localhost:1725/ Product / Show / 1
Demo: Model with Strong type
Request Flow Request View Controller Model HTTP Select View HTML Routing Select Controller
Demo: HTMLHelper
[object Object],[object Object],HTML Helper <%= Html. TextBoxFor (model => model. Body ) %> <input type=“text” name=“ Body ” id=“ Body ” />
[object Object],[object Object],[object Object],Handling post request Public ActionResult Create()  { string subject =  Request.Form[“Subject”]; } Public ActionResult Create( string Subject )  { // do something } Public ActionResult Create( Commentary commentary )  { // do something }
Demo: Form & Validation
Validation Define Validation in Model Server Side Validation Client Side Validation ModelState  Class to keep state of model   Data  Annotation  Model Binder Java script
Summary RESTful URL Complex URL F ull control over   HTML Clean HTML Event - driven programming (Drag n’ drop) Design for testing Cannot test easily Separation of Concerns Combines code and view ASP.NET MVC ASP.NET WebForms
Q & A

Weitere ähnliche Inhalte

Was ist angesagt?

Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
MaslowB
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe
 

Was ist angesagt? (20)

MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017
 
Mvc fundamental
Mvc fundamentalMvc fundamental
Mvc fundamental
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
MVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros DeveloperMVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros Developer
 
ASP .Net MVC 5
ASP .Net MVC 5ASP .Net MVC 5
ASP .Net MVC 5
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
Mvc Brief Overview
Mvc Brief OverviewMvc Brief Overview
Mvc Brief Overview
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Silver Light By Nyros Developer
Silver Light By Nyros DeveloperSilver Light By Nyros Developer
Silver Light By Nyros Developer
 
Module2
Module2Module2
Module2
 
MVC
MVCMVC
MVC
 
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
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
 

Ähnlich wie Introduction to ASP.NET MVC

ASP.NET 4 and AJAX
ASP.NET 4 and AJAXASP.NET 4 and AJAX
ASP.NET 4 and AJAX
KulveerSingh
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
Chui-Wen Chiu
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
SharePoint Saturday NY
 

Ähnlich wie Introduction to ASP.NET MVC (20)

ASP.NET 4 and AJAX
ASP.NET 4 and AJAXASP.NET 4 and AJAX
ASP.NET 4 and AJAX
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Build your website with angularjs and web apis
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apis
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Web api
Web apiWeb api
Web api
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
Introduction To ASP.NET MVC
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVC
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company india
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

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
 
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 New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
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
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Introduction to ASP.NET MVC

Hinweis der Redaktion

  1. Main purpose of mvc is to isolate business logic from user interface pros - Better maintain - Testable - Cleaner code
  2. Testability - Framework provides interface-base  easy to mackable Pluggable - Every component can easy replaced or customize (view replaced with ironPython) - Easy to use dependency injection design pattern (unity, spring) Friendly URL - Can build app for search engine friendly Existing ASP,NET feature still available - All exist asp.net feature still available ex: Master.Page, User Control, Session, Memberdhip - But ViewState and page life cycle are not support Full control of HTML - Write only html - no viewstate Open source - under MS-PL license
  3. Demo from empty project Show create view and run Show ViewData and run Demo TDD hello world
  4. Controller is responsible for handling incoming request - All public method that implement by Controller class, It can be invoke from web via url.
  5. Controller is responsible for handling incoming request - All public method that implement by Controller class, It can be invoke from web via url.
  6. Demo new template project Modify routing default to commentary Create model Commentary Create Commentary controller Create View Show F5 Create Method Details Use Model.Subject
  7. Demo new template project Modify routing default to commentary Create model Commentary Create Commentary controller Create View Show F5 Show feature for HTML helper Show JSON JsonRequestBehavior.AllowGet
  8. Show validation with statemodel Show validation with anotation in serverside Show validation with client
  9. Using ModelState Class =&gt; Encapsulates the state of model binding to a property of an action - method argument, or to the argument itself
  10. Uses the ‘Page Controller’ pattern . Each page has a code - behind class that acts as a controller and is responsible for rendering the layout . Uses the ‘Front Controller’ pattern. There is a single central controller for all pages to process web application requests and facilitates a rich routing architecture