MVC fundamentals
Ziazios Konstantinos- Twitter:@ziazios
wp:http://ziaziosk.wordpress.com/
Contents
- What is MVC and Why
- Parts of ASP.NET MVC
- Getting Started
- DEMO
- Facebook Page With MVC
Αψίδα του Γαλέριου
Η Καμάρα είναι κτίσμα της εποχής της Ρωμαϊκής «Τετραρχίας» (αρχές 4ου μ.Χ. αιώνα) και αποτελεί το ένα σκέλος (δυτικό) μίας στεγασμένης στοάς, που σχηματιζόταν από αψίδες και τόξα. Κατασκευάστηκε για να τιμηθεί ο Ρωμαίος ΑυτοκράτοραςΓαλέριος, όταν αυτός επέστρεψε νικητής στην πόλη (περί το 306 μ.Χ.)
MVC
Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces.
It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user.
Introduced at Xerox Parc in the 1970s
- src:wikipedia
Why it is relevant
- Separation of concerns
- Embraces the Web
- Is testable
ASP.NET MVC
- Asp.Net MVC1 Released on Mar 13, 2009
MVC Pattern architecture with WebForm Engine -
Asp.Net MVC2 Released on Mar 10, 2010
Strongly typed HTML helpers means lambda expression based Html Helpers -
ASP.NET MVC3 Released on Jan 13, 2011
Razor Engine -
ASP.NET MVC 4 Released on Aug 15, 2012
ASP.NET Web API - Mobile - Azure - ASP.NET MVC 5 Released on 17 October 2013
- Models : Plain Classes, DB, XML
- Controllers : Methods
- Views : HTML + RAZOR
- Routing -Bundling
- Security!
What it looks like!
public class Model1
{
[Required]
public string Field1 {get;set;}
}
.....
[Authorize]
public class HomeController : Controller
{
public ActionResult Index(string id)
{
Model1 model1 = GetModel1();
....
return View(model1);
}
}
......
@model Models.Model1
@{
ViewBag.Title = "MyView";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="row">
@Model.Field1
</div>
...
Show me the code!
How to draw a Panda
VSTUDIO
- GET STARTED
- MVC ON VSTUDIO
- SIMPLE EXAMPLE
DEMO
What we build
How ?
Try it yourself
VSTUDIO II
- Security
- Facebook Example
- The best is coming
Facebook Page
- Facebook Dev Account
- New app (WWW)
- Canvas URL
- Namespace
Visual Studio
- http://go.microsoft.com/fwlink/?LinkID=509965&clcid=0x409
- Enable SSL
- AppId/AppSecret/AppNamespace
Src: http://www.asp.net/mvc/overview/getting-started/aspnet-mvc-facebook-birthday-app
Thank you!
Questions ??
Next Topic
Next Topic II
ASP.NET MVC Introduction
By Ziazios Constantinos
ASP.NET MVC Introduction
This is a presentation for Thessaloniki.net Meetup of 21 November, 2014
- 1,819