© Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel Noam King CTO Sela College

Slides:



Advertisements
Similar presentations
.NET 3.5 SP1 New features Enhancements Visual Studio 2008 SP1 New features Enhancements Additional features/enhancements.
Advertisements

Introduction to ASP.NET MVC
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
Practical ASP.NET MVC 2 Rasmus Kromann-Larsen. This talk Introduction to ASP.NET MVC 2 Observations from my current project.
FIRST LOOK AT “ORCAS” Scott Guthrie General Manager.NET Developer Platform.
Jess Chadwick Website Manager, Infragistics
User Controls, Master Pages, GridView. Content User Controls Styles, Themes, Master Pages Working with Data GridView Muzaffer DOĞAN - Anadolu University2.
Web Applications Development Using Coldbox Platform Eddie Johnston.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Microsoft Entity Framework v1.1 over Oracle Database Erez.
LHCbPR V2 Sasha Mazurov, Amine Ben Hammou, Ben Couturier 5th LHCb Computing Workshop
AMS304: Introduction to the ASP.NET Model View Controller (MVC) Framework Scott Hanselman Eilon Lipton Microsoft Microsoft
User Group 2015 Version 5 Features & Infrastructure Enhancements.
ASP.NET 4.0 Web Developers User Group Israel June 2009.
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,
Jess Chadwick Lead Code Monkey Infragistics Website Team Todd Snyder Development Team Lead Infragistics Experience Design Group.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
ASP.NET 5 Visual Studio 2015 Templates Bill Wolff Rob Keiser June 10, 2015.
AJAX in ASP.NET James Crowley Developer Fusion
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
ASP.NET and Model View Control Jesper Tørresø ITNET2 F08.
Marc Ziss Z Consulting Code Name 'Oryx' Web application scaffolding Easy to dynamically display pages based on the data model of.
Building Web Sites with ASP.NET MVC Framework Noam King CTO Sela College
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
Introducing Dynamic Data DemosRoadmap Feedback and Q&A.
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.
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.
Connect with life Sundararajan Subramanian SDE | Microsoft R&D India Pvt Ltd.,
Bradley Millington Senior Program Manager Microsoft Corporation SESSION CODE: WEB 306.
Ventsislav Popov Crossroad Ltd.. 1. What is AJAX?  AJAX Concept  ASP.NET AJAX Framework 2. ASP.NET AJAX Server Controls  ScriptManager, UpdatePanel.
What’s New for Web Developers in ASP.NET and Visual Studio 2008 Kate Gregory Microsoft Regional Director
Jeff King Senior Program Manager Microsoft Session Code: WIA204.
J. Michael Palermo IV Director of Development Interface, USA WUX203.
Getting Started with ASP.NET MVC BRIJ BHUSHAN MISHRA.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
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.
Web Content Management with MOSS 2007 Patrick Tisseghem
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
ASP.NET MVC Telerik Academy
USING SHAREPOINT TO CREATE YOUR PUBLIC WEBSITE JUNE 13, 2:45 PRESENTED BY: MARK GEROW & CHARLES FARAMARZI-RAD, FENWICK & WEST LLP MICHAEL P. KOLB,
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.
Scott Guthrie
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Module 10: Data Access in ASP.NET. Overview Overview of the ASP.NET Data Access What is Data Access List of Data Source Control What is Data Bound How.
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Course Introduction Svetlin Nakov Telerik Corporation
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
What was new in VS Studio 2008 A bird eye view from the height of ft By: Shahzad Sarwar Software Architect Comsoft computer consultants.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
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.
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
//liveVirtualacademy2011/ What’s New for ASP.NET 4.5 and Web Development in Visual Studio 11 Developer Preview Γιώργος Καπνιάς MVP, MCT, MCDP, MCDBA, MCTS,
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Web Technology Solutions
MVC Architecture, Symfony Framework for PHP Web Apps
ASP.NET MVC Introduction
Haritha Dasari Josue Balandrano Coronel -
ASP.NET 3.5 Mike Ormond Developer & Platform Group Microsoft Ltd
ASP.NET Roadmap Mike Ormond Developer & Platform Group Microsoft Ltd
Lecture 1: Multi-tier Architecture Overview
Data Driven ASP.NET Web Forms Applications Deep Dive
MIX 09 2/28/2019 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
7/19/2019 2:53 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Introduction to ASP.NET Parts 1 & 2
Presentation transcript:

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Noam King CTO Sela College Noam King CTO Sela College

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Classic ASP.NET

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Why should I care? 3 main reasons : –Build applications faster –Scale easily –Test better

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Two main players Dynamic Data –Build a presentation layer based on a database schema in just a few minutes MVC – Clean separation of Layers

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel What are you going to see ? Dynamic Data projects MVC Framework Customizing DDC and MVC MVC and Dynamic data altogether Much more…

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel

What Is Dynamic Data? An easy powerful way to build a data-driven Web site Allows you to get started quickly using scaffolding completely customized UI through templates and pages Validation and business rules specified on data model flow through to UI Flexible URL routing, based on data schema and separate from the physical page New DDC make scenarios like sorting, paging, editing, and filtering remarkably easy to implement Now in Microsoft.NET Framework 3.5 SP1

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data – First Steps

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Scaffolding // Global.asax: Application_Start model.RegisterContext (typeof(NorthwindDataContext), new ContextConfiguration() { ScaffoldAllTables = true }); // WARNING: This enables scaffolding for every table in the model. To enable scaffolding on a per-table or per-column basis, you can use attributes on the model: [MetadataType(typeof(ProductMeta))]public partial class ProductMeta [ScaffoldTable(true)]{ public partial class Product [ScaffoldColumn(true)] { public object UnitPrice { get; set; } …} } // WARNING: This enables scaffolding for every table in the model. To enable scaffolding on a per-table or per-column basis, you can use attributes on the model: [MetadataType(typeof(ProductMeta))]public partial class ProductMeta [ScaffoldTable(true)]{ public partial class Product [ScaffoldColumn(true)] { public object UnitPrice { get; set; } …} }

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Routing // Global.asax: Application_Start RouteTable.Routes.routes.Add (new DynamicDataRoute("{table}/{action}.aspx") { Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }), Model = model }); RouteTable.Routes.routes.Add (new DynamicDataRoute("{table}/List.aspx") { Action = PageAction.List, ViewName = "List", Model = model }); RouteTable.Routes.Add(new DynamicDataRoute("MyCategoryDetail/{CategoryID}") { Model = model, Table = "Categories", Action = "Details" });

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Scaffolding And Routing

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Data Model Annotations System.ComponentModel.DataAnnotations namespace –Scaffold attribute // as seen in previous demo –Display attributes DisplayField DisplayFormat DisplayColumn Description –Validation attributes Required Range RegularExpression StringLength DataType (e.g., , phone number, …)

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MetaModel And MetaTable MetaModel –RegisterContext methods –Access to MetaTable objects MetaTable –Schema information, MetaColumns –Attributes collection // Model annotations –Scaffold property –ListActionPath and GetActionPath() method –GetQuery() method

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Metadata And Data Model Validation

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel UI Customization Dynamic Data provides UI customization at many levels (from least to most control) PageTemplatesFieldTemplatesUIHint/DataType on ModelCustomPages UIHints on DynamicField/DynamicControl

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Field Template Controls Allow customization of columns using template based controls –Based on the type of the column –Source code for standard templates is provided –Can be overriden with DataType and UIHint attributes or properties Easy to create –Implement method to set and get values

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data Controls DynamicDataManager GridView, DetailsView –DynamicDataField ListView, FormView –DynamicControl LinqDataSource, EntitiesDataSource –DynamicControlParameter –DynamicQueryStringParameter DynamicValidator DynamicFilter (UserControl), FilterRepeater

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel UI Customization

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data Wizard Preview Scenario: Quickly create partial classes and custom pages for Dynamic Data Current features –Generates a data model from a database –Generates partial classes based on data model –Creates custom List, details pages based on model –Uses ListView control for CSS-friendly markup Preview download available: –

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data Wizard Preview Upcoming features –Ability to run within existing Web site –Ability to choose existing data model –Entities data model support –Master page and CSS support –Edit and insert forms –Additional layouts (div, ul)

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data Wizard

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Migrating Existing Pages Scenario: Reduce code in existing pages Validation –Move validation to data model instead of in individual pages. Change in one place affects entire site Field templates –Add custom controls in one place instead of in each of your pages –Enable custom controls on model

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Migrating Existing Pages

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel DDC – Short Summary Easy to Create Easy to Customize Everything Easy to integrate

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data Roadmap Support for more data sources ADO.NET Data Services (also known as Project code name “Astoria”) Plain CLR objects Binding using ObjectDataSource Support for more UI customization Attribute for ordering columns Localized display name and description attributes Insert page take defaults from fitlers More field templates Enum based columns Images from database Support for many to many columns Support for object inheritence (Linq and Entity Framework)

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Additional Resources Dynamic Data home: – Code Gallery releases: – Product Team contacts and blogs:

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel

So… What is MVC? Model ControllerView Browser requests /Artists/ Route is determined Controller is activated Method on Controller is invoke Controller does some stuff Renders View, passing in custom ViewData URLs are rendered, pointing to other Controllers

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC – First Steps

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel What MVC is not ? Not the new Web Forms 4.0 Not replacing Web Forms, but Adds to it It can not use Web Controls Not a whole new engine but sits on ASP.NET engine Not the best solution for REST

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel What MVC is? Maintain Clean Separation of Concerns –Easy Testing –Red/Green TDD –Highly maintainable applications by default Extensible and Pluggable –Support replacing any component of the system –Enables Inversion Of Control (IOC) / Dependency Injection (DI)

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel What MVC is ? (cont.) Enable clean URLs and HTML –SEO and REST friendly URL structures Great integration within ASP.NET –All the same providers still work –Membership, Session, Caching, etc. –ASP.NET Designer Surface in VS2008 Tooling Support –Intellisense, Refactoring, Debugging –Project Templates –.aspx View pages have Visual Studio designer support

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Flow Request ControllerController Step 1 Incoming request directed to Controller

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Flow ControllerController Model Step 2 Controller processes request and forms a data Model

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Flow ControllerController ViewView Step 3 Model is passed to View

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Flow ControllerController ViewView Step 4 View transforms Model into appropriate output format

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Flow ResponseResponse ControllerController ViewView Step 5 Response is rendered

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Request Flow – in more detail Request HTTP Routing Route Route Handler Http Handler Controller View Engine View Response

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Customization

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Routing Engine Map incoming URLs to the application and route them so that the right Controller and Action method executes to process them Construct outgoing URLs that can be used to call back to Controllers/Actions

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Routing Demo

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Action Filters Inject code interceptors into the request of a MVC controller Package-up and re-use functionality in a clean declarative way Predefined Action Filters Custom Filters

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Action Filters

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel TempData

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel TempData

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Ajax Support Ajax is not just “Update Panel” You can use –Page methods –Web Services They all require you to write a lot of javascript MVC Ajax helps with Forms and ActionLinks !!

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Ajax Support

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Extensibility Views Controllers Models Routes …are all Pluggable

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel ViewEngines View Engines render output You get WebForms by default Can implement your own –MVCContrib has ones for Brail, Nvelocity –NHaml is an interesting one to watch View Engines can be used to –Offer new DSLs to make HTML easier –Generate totally different mime/types Images, RSS, JSON, XML, OFX, VCards, whatever.

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel View Engine IViewEngine public interface ViewEngineBase { public void RenderView(ViewContext viewContext); }

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel NHaml – Extreme Custom Views Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="List.aspx" Inherits="MvcApplication5.Views.Products.List" Title="Products" %> CodeBehind="List.aspx" Inherits="MvcApplication5.Views.Products.List" Title="Products" %> ( ) ( ) </asp:Content>

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel NHaml – Extreme Custom Views %h2= ViewData.CategoryName %ul - foreach (var product in ViewData.Products) %li = product.ProductName.editlink = Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID }) = Html.ActionLink("Add New Product", new { Action="New" }) - foreach (var product in ViewData.Products) %li = product.ProductName.editlink = Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID }) = Html.ActionLink("Add New Product", new { Action="New" })

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Extensibility

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Testing 1,2,3… Mockable Intrinsics –HttpContextBase, HttpResponseBase, HttpRequestBase Extensibility –IController –IControllerFactory –IRouteHandler –ViewEngineBase

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Testing Controller Actions No requirement to test within ASP.NET runtime. –Use Moq or RhinoMocks or TypeMock –Create Test versions of the parts of the runtime you want to stub

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Testing

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data and MVC Initial release targets web forms Later release will include MVC support Same concepts apply –Model metadata –Page templates –Field templates

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Dynamic Data and MVC

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC RC Views without Code-Behind Html Helpers with Expression Support Scaffolding Support FileResult, JavaScriptResult and more… Much more to come…

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Roadmap –Improved Action Invoker - Refactorings to enable Async, DLR, and Dynamic Action Filters –Dynamic Action Filters - Provide ability to apply filters at runtime, and not just compile time via attributes. –Subcontrollers - More details to follow. –Asynchronous Controller Actions - Provide an asynchronous programming model for controller actions.

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Roadmap –Sessionless controllers - Allow controllers to not use session state on a controller by controller basis (without this, you can turn session on or off for the entire site) –MVC Declarative Helpers/Designers - Allow using declarative design time markup for action links, repeater, etc… (These would be a thin veneer over our current helpers) –ScriptManager-Lite - Some means for script manager style support for embedded scripts

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel MVC Roadmap –MVC Ajax Extenders - Ajax.Extend method along with some included extenders –Ajax View Package - Package up multiple views to be rendered on the client

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Sexy Microsoft Framework Easy from the first date, yet respectful Staying young in and The right way to do get the job done. Customizable all over. Inventing and not Reinventing

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Resources My Blog – Noam King Scott Guthrie Blog Phil Hack The Official ASP.NET Site Stephen Walther’s blog test-driven-development-with-visual-studio-2008-unit- tests.aspx test-driven-development-with-visual-studio-2008-unit- tests.aspx

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel