Getting Started with ASP.NET MVC
description
Transcript of Getting Started with ASP.NET MVC
![Page 1: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/1.jpg)
Getting Started with ASP.NET MVCBRIJ BHUSHAN MISHRA
![Page 2: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/2.jpg)
Who Am I? Brij Bhushan Mishra Microsoft ASP.NET/IIS MVP
Former Code Project MVP
Blogger/Author/Speaker
http://brijbhushan.net
@brij_bhushan
![Page 3: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/3.jpg)
Whenever Microsoft introduces new technology,Do you welcome like it?
![Page 4: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/4.jpg)
Agenda
Overview Why Demo Execution Flow
Model, View, Controller
HTML Helpers
One more Demo
![Page 5: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/5.jpg)
Overview
ASP.NET Framework
Web Forms MVC Web Pages
![Page 6: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/6.jpg)
ASP.NET MVC
Controller
Model View
Request (Controller\Action)
![Page 7: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/7.jpg)
ASP.NET MVC
Route Handler
http://localhost/Event/List
Controller
Model View
![Page 8: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/8.jpg)
Why ASP.NET MVC More control over HTML and JavaScript
Clean separation of Concerns
No ViewState or Post Back events
Test Driven Development
Cleaner and SEO friendly URLs
ASP.NET Providers (Session, Caching, Member Ship) works
Easy integration with Client Side libraries
Not a replacement of Web Forms
![Page 9: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/9.jpg)
• Visual Studio 2012• Visual Studio 2010• Visual Studio 2008 SP1 + Download and Install MVC Package
ASP.NET MVC
![Page 10: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/10.jpg)
Request
Perform Routing
Create Controller
Create HTTP Handler
Execute Controller/Ac
tionResponse
ViewView Engine
ASP.NET MVC Request Flow
![Page 11: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/11.jpg)
Benefits….. Post back
ViewState
Tricky page life cycle Interview Questions
No Design Time Support
![Page 12: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/12.jpg)
ModelCore of your Application
Contains business logic , data models( View Models), Validation… etc
Any data access technology can be used like Entity Framework, ADO.NET or any other
![Page 13: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/13.jpg)
ControllerControls the execution flow
Executes logic, Load the data and chooses the view
Can call other controller, redirect to other URLs
![Page 14: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/14.jpg)
ViewResponsible for displaying UI. Contains information for presentation, formatting, searching, sorting..
Knows the models and display the data accordingly (No logic here)
HTML helpers are used for generating the mark up
Can be used with loosely typed and strongly typed data
![Page 15: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/15.jpg)
HTML Helpers A static methods that returns the html string
Can have our own custom HTML helper methods
Few are like◦ Html.ActionLink()◦ Html.BeginForm()◦ Html.CheckBox()◦ Html.DropDownList()◦ Html.EndForm()◦ Html.Hidden()◦ Html.ListBox()◦ Html.Password()◦ Html.RadioButton()◦ Html.TextBox()
![Page 16: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/16.jpg)
One more..
![Page 17: Getting Started with ASP.NET MVC](https://reader035.fdocuments.us/reader035/viewer/2022062501/56815cfe550346895dcafcd9/html5/thumbnails/17.jpg)
Thank you