ASP.NET MVC3 Melick Rajee Baranasooriya http://melick-rajee.blogspot.com
ASP.NET
MVC3
Melick Rajee Baranasooriya
http://melick-rajee.blogspot.com
Introduction
ASP.NET MVC 3 is a framework for building
Scalable
Standards-based web applications
using well-established design patterns and
the power of ASP.NET and the .NET Framework.
Features
Rock Features
NuGet
Razor View Engine
HTML Helpers
Dependency Injection
Model Validation
Features … Improvements
Sessionless Controllers
ViewBag Property
JSON Model Binding
Granular Input Validation
Partial Page Output Cache
Global Action Filters
New Action Result Types
Technology Stack
Web Platform Installer 3.0
Visual Studio 2010
Express
Web Developer Express
Visual Studio 2010 SP1
MVC 3
IIS Express
[SQL Server 2008 R2 Express]
Model
Model
How It works
Controller Request
View Response
Model
/Customer/Add
/Customer/Add
CustomerController
Controllers
We are going to look
Routing
Controller Actions
Action Filters
Action Parameters
Action Results
Routing
http://localhost/Customer/Edit/5
Routing ..
Global.asmx
Routing ..
Accessing Routing Data
RouteData.Values["Controller"]
RouteData.Values["Action"]
RouteData.Values["Id"]);
Action Results
ContentResult
EmptyResult
FileResult
HttpStatusCodeResult
HttpNotFoundResult
JavaScriptResult
JsonResult
RedirectToAction
RedirectResult
RedirectToRouteResult
ViewResultBase
Many ..
Action Selectors Decorate Control Actions
ActionName
AcceptVerbs
GET
POST
DELETE
..
Action Filters
Uses to restrict the action based on filer
[Authorize(Roles="Admin")]
How Routing Works
Accessing Routing Data
Action Results
Action Selectors
Views
MVC 3 Supports
Aspx
Razor
Razor
Simple
Powerfull
Views ..
Strong Type View
Scaffold Template
Create
List
Details
Edit
..
Partial View
Views ..
Razor Syntax @
Custom Helpers
Partial Views
Declarative Custom Helper
Models
Models
Data Annotations
Model Validation
JQuery
JQuery
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.
Demo
Thank You. http://melick-rajee.blogspot.com