ASP.Net MVC Framework

Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Introduction to ASP.NET MVC : 

Introduction to ASP.NET MVC

Agenda : 

Agenda What's MVC What's ASP.NET MVC Goals of ASP.NET MVC How does it work?

What's MVC : 

What's MVC View Model Controller Defines application behavior Maps user action to model Select view to response Represent enterprise data Business rules that govern access/update data Render content of model

What's ASP.NET MVC : 

What's ASP.NET MVC New framework from Microsoft that builds on top standard ASP.NET engine

Goals of ASP.NET MVC : 

Goals of ASP.NET MVC Testability Pluggable Friendly URLs (REST URL) Existing ASP.NET feature still available Full control of HTML Open source

ASP.NET MVC : 

ASP.NET MVC ASP.NET MVC 1.0 (Dec, 2008) ASP.NET MVC 2.0 Beta (Nov, 2009)

ASP.NET MVC : 

ASP.NET MVC .NET Framework 3.5 Visual Studio 2008 (service pack 1) Download (asp.net/mvc) Visual Studio 2010 (included)

Demo: Hello World : 

Demo: Hello World

How does it work? : 

Controller is responsible for handling incoming request Routing system decides how URLs map into particular controllers and actions How does it work? Action in controller Controller

Routing : 

Component is first hit by a request The rules are configured in Global.asax Routing

Demo: Model with Strong type : 

Demo: Model with Strong type

Request Flow : 

Request Flow

Demo: HTMLHelper : 

Demo: HTMLHelper

HTML Helper : 

Provide method for creating HTML control Support Strong-type HTML Helper <%= Html.TextBoxFor(model => model.Body) %> <input type=“text” name=“Body” id=“Body” />

Handling post request : 

Request variable Action method parameter ModelBinder Handling post request

Demo: Form & Validation : 

Demo: Form & Validation

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 : 

Summary

Q & A : 

Q & A