Mvc3

Páginas: 35 (8581 palabras) Publicado: 22 de marzo de 2012
Getting started with MVC3
By Scott Hanselman
This document is an unofficial printable version of ASP.NET MVC 3 tutorial written by Scott Hanselman. This document is free and was edited by Gustavo Azcona to be shared with the developer community. It’s provided "as is" without warranty of any kind. Enjoy it!

0

Getting started with MVC3

Page | 1

Contents
Intro to ASP.NET MVC 3......................................................................................................................................................... 3 What You'll Build ............................................................................................................................................................... 3 Skills You'll Learn........................................................................................................................................................... 5 Getting Started ............................................................................................................................................................. 5 Creating Your First Application.......................................................................................................................................... 6 Adding a Controller ......................................................................................................................................................... 10 Adding a View................................................................................................................................................................. 15 Changing Views and Layout Pages ............................................................................................................................... 20 Passing Data from the Controller to the View .............................................................................................................. 23 Adding a Model............................................................................................................................................................... 28 Using NuGet to Install EFCodeFirst .............................................................................................................................. 28 Adding ModelClasses.................................................................................................................................................. 32 Accessing your Model's Data from a Controller ................................................................................................................ 35 Strongly typed Models and the @model keyword........................................................................................................37 Creating a Connection String and Working with SQL Server Express ............................................................................. 40 Adding a Create Method and Create View ....................................................................................................................... 47 Displaying the Create Form......................................................................................................................................... 47 Processing the HTTP-POST........................................................................................................................................... 52 Creating a Movie......................................................................................................................................................... 54 Adding a New Field to the Movie Model and Table .......................................................................................................... 57 Adding a Rating Property to our Movie Model ............................................................................................................. 57 Managing Model / Database Schema Differences...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • MVC3 desde cero

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS