mvc4 intro
DESCRIPTION
Introducción a MVC4TRANSCRIPT
![Page 1: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/1.jpg)
ASP.NET MVC 4OPTA II
![Page 2: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/2.jpg)
MVC4
ASP.NET MVC es un framework de desarrollo web en la plataforma .NET con un enfoque en código limpio, separación de responsabilidad (concerns) y facilidad para probar.
![Page 3: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/3.jpg)
MVC4
MVC4 trabaja con .NET4 y .NET4.5
En MVC no se trabaja alrededor de paginas ASPX, controles, postbacks, viewstatus u otros eventos del ciclo de vida de una pagina;
En lugar de ello se definirán controladores, acciones y vistas.
![Page 4: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/4.jpg)
MVC4 – Patron MVC
MVC proviene de Model View Controller, un patron de diseno que es
muy popular en el desarollo web.
![Page 5: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/5.jpg)
MVC4 – Model
MODEL
Business Logic.
El dominio en el que el software esta construido.
![Page 6: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/6.jpg)
MVC4 – View
VIEW
UI Logic
La representacion visual del modelo, en un contexto especifico.Usualmente es el markup resultante que se renderiza al browser.
![Page 7: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/7.jpg)
MVC4 – Controller
CONTROLLER
Input Logic
El coordinador que provee el enlace entre la vista y el modelo. El controlador es responsable por procesar las entradas, actuar sobre el modelo y decidir que accion debera ser realizada.
![Page 8: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/8.jpg)
MVC4 – Patron MVC
![Page 9: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/9.jpg)
MVC4 – Nuevo en ASP.NET MVC3/4
.NET 4 Razor view engine Package management with NuGet Improved extensibility Global action filters Dynamic language features Partial page output caching Ajax improvements Enhancements to the validation infrastructure Mobile templates Web API
![Page 10: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/10.jpg)
MVC4 – Razor View Engine
Una de las partes clave de las nuevas tecnologias ASP.NET
Provee una manera concisa de mezclar codigo y markup dentro del mismo archivo.
![Page 11: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/11.jpg)
MVC4 – comparacion de View Engines
Web Forms view engine <%@ Page Language="C#"
Inherits="System.Web.Mvc.ViewPage<Product[]>" %>
<ul>
<% foreach(var product in Model) { %>
<li><%: product.Name %></li>
<% } %>
</ul>
![Page 12: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/12.jpg)
MVC4 – comparacion de View Engines
Razor View Engine @model Product[]
<ul>
@foreach(var product in Model) {
<li>@product.Name</li>
}
</ul>
![Page 13: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/13.jpg)
MVC4- Ambiente de desarollo
Visual Studio 2010SP1/2012
MVC4 : disponible en
Web Platform Installer:http://www.asp.net/mvc
![Page 14: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/14.jpg)
MVC4- Crear un nuevo proyecto
File>New Project>Visual C#> Web>ASP.NET MVC4 Web application
Selecciona Razor Engine y Internet application.
Selecciona OK.
![Page 15: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/15.jpg)
MVC4- Crear un nuevo proyecto
![Page 16: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/16.jpg)
MVC4- Estructura de un proyecto
![Page 17: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/17.jpg)
MVC4 – Agregar el modelo
![Page 18: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/18.jpg)
MVC4 – Stub de persistencia
![Page 19: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/19.jpg)
MVC4 - Agregar Controller
![Page 20: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/20.jpg)
MVC4 – Agregar Views
![Page 21: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/21.jpg)
MVC4 – Agregar Views
![Page 22: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/22.jpg)
Otros recursos..
http://www.asp.net/mvc/overview/getting-started
http://pluralsight.com/training/players/PSODPlayer?author=scott-allen&name=mvc3-building-intro&mode=live&clip=0&course=aspdotnet-mvc3-intro
ASP.NET MVC4 In Action MVC MovieAPP tutorial (CRUD app )
http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/intro-to-aspnet-mvc-3
![Page 23: Mvc4 Intro](https://reader034.vdocuments.mx/reader034/viewer/2022042700/55946e251a28abef718b4642/html5/thumbnails/23.jpg)
Basado en el libro :ASP.NET MVC4 In Action