Friday, May 11, 2012

ASP.Net MVC: Overview

Controllers

  • C# classes that handle incoming request to the application
  • Retrieves model data
  • Specifies the View template that should return the response to the browser. If no particular view name is specifies, looks for a View with the same name as the Controller method name in the Views subfolder

Models

  • C# classes that represent data of the application
  • Contains declarative attributes to enforce business rules

Views

  • Razor source files (.cshtml) that dynamically generate HTML responses

Development

  • Choose IIS Express for the hosting environment
  • Runs on top of ASP.NET. Caching, handlers, diagnostics... work the same as they do in ASP.NET
  • URLs as APIs
  • Dynamic language capabilities of CLR
  • Convention over configuration
  • Razor to produce clean HTML
  • Sessionless Controllers
  • High volume AJAX requests, better performance
  • SEO improved redirects