Jess Chadwick Lead Code Monkey Infragistics Website Team Todd Snyder Development Team Lead Infragistics Experience Design Group.

Slides:



Advertisements
Similar presentations
Sharpen Your MVC Views with Razor By Jon Marozick.
Advertisements

INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
Jess Chadwick Website Manager, Infragistics
{ Model View Controller ASP.NET By Scott Crooks & Maggie Wettergreen.
Web Applications Development Using Coldbox Platform Eddie Johnston.
3rd Annual Plex/2E Worldwide Users Conference Page based on Title Slide from Slide Layout palette. Design is cacorp Title text for Title or Divider.
Razor. Slide 2 Remember this? Browser Web Server HTTP Request HTTP Response (Web page / code) Client code (script) Interpret request Generate HTML and.
MVC Controller Architecture Deep Dive. Holistic Look Where do controllers fit?
Virtual techdays INDIA │ November 2010 ASP.Net MVC Deep Dive Sundararajan S │ Associate Tech Architect, Aditi Technologies.
AMS304: Introduction to the ASP.NET Model View Controller (MVC) Framework Scott Hanselman Eilon Lipton Microsoft Microsoft
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
JavaScript & jQuery the missing manual Chapter 11
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Ch6:creating consistent looking web sites. Master pages Master page defines a combination of fixed content and content place holder to hold the web page(.aspx)
Building a UI with Zen Pat McGibbon –Sales Engineer.
ASP.NET and Model View Control Jesper Tørresø ITNET2 F08.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Building Web Sites with ASP.NET MVC Framework Noam King CTO Sela College
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
Introduction to ASP.NET MVC Information for this presentation was taken from Pluralsight Building Applications with ASP.NET MVC 4.
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
Peter Laird. | 1 Building Dynamic Google Gadgets in Java Peter Laird Managing Architect WebLogic Portal BEA Systems.
MVC A new Web Project Type for ASP.NET. An option. More control over your More control over your A more easily Testable Framework. Not for everyone.
Jonathan Canfield Mavin Lisa Giss Professor Kenytt D. Avery
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Noam King CTO Sela College
Getting Started with ASP.NET MVC BRIJ BHUSHAN MISHRA.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
ASP.NET MVC in Action Austin Code Camp, 2009 Jeffrey Palermo Chief Technology Officer Headspring Systems.
2 ASP.NET MVC Scott Hanselman Senior Program Manager Microsoft.
Getting started with ASP.NET MVC Dhananjay
ASP.Net MVC Extensibility, scalability and testability Andrew Locatelli Woodcock.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Adxstudio Portals Training
ASP.NET MVC Telerik Academy
Adxstudio Portals Training
Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner.
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
Scott Guthrie
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
Model-View-Controller an introduction to MVC design pattern with Castle.MonoRail Presentation: v1.0 Prepared by: Chorn Sokun
Flux & React Web Application Development Mark Repka, Rich McNeary, Steve Mueller.
Intro to MVC5 Bryan Soltis Bit-Wizards - Director of Technology & Research.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
Name Title Microsoft Corporation
INTRODUCTION TO MVC BY SUHA MNEIMNEH. WHAT’S THE AGENDA What is MVC? MVC components MVC vs web forms vs ASP.NET vocabulary When to create MVC application.
ASP.NET Overview Brian Hitney Developer Evangelist Microsoft Corporation
Unit testing of the Services Telerik Software Academy Web Services and Cloud.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Introduction to ASP.NET MVC [Name] [ Address] [Blog URL]
Introduction to MVC Slavomír Moroz. Revision from Previous Lesson o ASP.NET WebForms applications Abstract away HTTP (similar to desktop app development)
Building rich web applications with ASP.NET AJAX Mike Ormond Developer & Platform Evangelism Group, Microsoft Ltd Developer & Platform Evangelism Group,
Jim Fawcett CSE686 – Internet Programming Spring 2014
Getting Started with MVC 5 and Visual Studio 2013
Introduction to .NET Florin Olariu
An introduction to ASP.Net with MVC Nischal S
Introduction to ASP.NET MVC
Jim Fawcett CSE686 – Internet Programming Spring 2012
Social Media And Global Computing Introduction to The MVC Pattern
Routing, Controllers, Actions, Views
ASP MVP Web applications and Razor
ASP.NET MVC Introduction
ASP.NEXT The ASP.NET 3.5 Extensions
MASTER PAGES.
ASP.NET MVC Imran Rashid CTO at ManiWeber Technologies.
ASP.NEXT Mike Ormond Developer & Platform Group Microsoft Ltd
Presentation transcript:

Jess Chadwick Lead Code Monkey Infragistics Website Team Todd Snyder Development Team Lead Infragistics Experience Design Group

Model – View - Controller Model Controller View

Controller – The Traffic Cop  Handles User Input  Interacts with Model/Data  Select View to Render

Controllers MVC - WebForm

ASP.NET Page Lifecycle

Request Flow Request HTTP Routing Route Route Handler Http Handler Controller View Engine View Response

Controllers – Page Routing

Controllers – Actions

Controllers – Defining Actions

Controllers – Parameters  RouteData: Contains Name/Value Pairs  Form, Query String, and/or Cookie  Missing Reference/Nullable Types set to null  Nullable optional parameters  Base class: Request and Response Methods

Controllers – Action Results  ViewResult  RedirectResult  RedirectToRouteResult  ContentResult  JsonResult  EmptyResult

Controllers – Attributes  PrincipalPermission  NonAction  ActionFilter

Controllers – Action Filters  Attach additional behaviors to actions  Before & After Action Execution  Before & After Result Execution  Useful for logging, compression, etc.

Controllers – Unit Testing

Testing Controller Actions  No requirement to test within ASP.NET runtime!  Use RhinoMocks, TypeMock, Moq, etc.  Create Test versions of the parts of the runtime you want to stub [TestMethod] public void ShowPostsDisplayPostView() { TestPostRepository rep = new TestPostRepository(); BlogController controller = new BlogController(rep); var result = controller.ShowPost(2); Assert.AreEqual("showpost", result.ViewName); Assert.IsTrue(repository.GetPostByIdWasCalled); Assert.AreEqual(2, repository.LastRequestedPostId); } [TestMethod] public void ShowPostsDisplayPostView() { TestPostRepository rep = new TestPostRepository(); BlogController controller = new BlogController(rep); var result = controller.ShowPost(2); Assert.AreEqual("showpost", result.ViewName); Assert.IsTrue(repository.GetPostByIdWasCalled); Assert.AreEqual(2, repository.LastRequestedPostId); }

ASP.NET MVC: Views

Model – View - Controller Model Controller View

Views – What are they?  Render output  Usually pretty “stupid”

It’s all about the “ViewData” Views - Working with Data

Views - Strongly-Typed Data  Inherits ViewPage  DEMO: Strongly-Typed View

Views - Weakly-Typed Data  Inherits ViewPage  DEMO: Weakly-Typed View

“I can see!” View Engines

View Engines - Definition  Figure out how to render the markup  View Locator finds the template  Pluggable  Web Forms, Nvelocity, Brail, Nhaml, etc.  Roll your own  Implement IViewEngine

View Engines - WebFormViewEngine  Default engine based on Web Forms markup  Familiar Environment  Layout:.master  Content:.aspx  User Controls:.ascx

View Engines - WebFormViewLocator  Standard, default layout: /Views /{Controller Name} /*.aspx /*.ascx /Shared /*.master /*.aspx /*.ascx

Think of them as your personal assistants. UI Helpers

Why do we need UI Helpers?  More control = less done for you  Avoid writing “boring” markup  Encapsulate what varies  Replace Web Forms server controls

Extension Methods Revisited  New.NET 3.0 feature  Static Methods posing as built-in behavior  Make your life a whole lot easier  Allow easy extensibility!

UI Helpers - Common/Useful Helpers Form HelpersUrl/Link/Content Helpers  Html.Hidden()  Html.TextBox()  Html.TextArea()  Html.RadioButton()  Html.RadioButtonList()  Html.DropDownList() method(name, value, attributes)  Html.ActionLink ()  Html.RouteLink()  Html.Encode()  Html.AttributeEncode()  Url.Action()  Url.RouteUrl()  Url.Encode(contentPath)  Url.Content(contentPath)

No, not … Back to basics! DEMO: Working with Forms

Rendering Components

User Controls  Extension Methods  Html.RenderUserControl(virtualPath)  Html.RenderUserControl(virtualPath, data)  Server Controls  Traditional Web Forms style!  Third-Party Controls  DEMO: Create and use a user control

Enriching the Client Experience

ASP.NET AJAX? Nope!

Filling the Gap  Roll your own  Popular Frameworks  jQuery  prototype  JavaScriptMVC  Rico  script.aculo.us  ASP.NET AJAX (client library)  DEMO: MVC & ASP.NET AJAX

Jess Chadwick Blog: Todd Snyder Blog:

 The Bits  ASP.NET MVC Preview 3:  ASP.NET MVC Source Code:  Quickstart   Videos  ASP.NET:  MIX:  Community/Blogs  ASP.NET Forums:  Scott Guthrie (ScottGu):  Scott Hanselman:  Phil Haack:  Sample Apps  MVC Samples:  CodeCampServer: Jess Chadwick Todd Snyder Resources