Top Banner
What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College [email protected] http://blogs.microsoft.co.il/blogs/oric/
28

What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College [email protected]

Dec 17, 2015

Download

Documents

Arron Flowers
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

What’s New in ASP.NET 4.5

Ori Calvo, 2012John Bryce Hi-Tech [email protected]://blogs.microsoft.co.il/blogs/oric/

Page 2: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

ObjectivesPart 1 - ASP.NET Web Forms 4.5Part 2 - IDE EnhancementsPart 3 - ASP.NET MVC 4

Page 3: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

PrerequisitesASP.NET DeveloperGood understanding of HTML and

HTTPGood understanding of C#

Language

Page 4: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Getting StartedInstall Visual Studio 11 Beta

◦http://www.microsoft.com/visualstudio/11/en-us

Some new features require Windows 8 Consumer Preview◦http://

windows.microsoft.com/en-us/windows-8/download

◦And then install Visual Studio 11

Page 5: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

ASP.NET Web Forms 4.5Strongly Typed Data ControlModel BindingUnobtrusive validationHTML5 UpdatesCore Runtime and Framework

◦Bundling and Minification◦Support for Web Sockets API

Page 6: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Strongly Typed Data Controls

Still uses the <%# and %> syntax

Uses a new “ItemType” attributeNew syntax is supported under a

web control template◦Item◦BindItem

IntelliSense works !!!Invoking a method is supported

Page 7: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Model BindingNew data binding mechanismA data bound control can specify

◦Select/Update/Insert/Delete methodsMethod’s parameters are

automatically bound to control state◦Can bind parameters to other value

providersValidation is supported through

DataAnnotation

Page 8: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Is it MVVM?New model binding makes

ASP.NET feels like an MVVM framework◦Each control is bound to an ItemType

(A.K.A ViewModel)Use AutoMapper to switch

between Model and ViewModelCan it be testable too?

◦See my blog: http://blogs.microsoft.co.il/blogs/oric/archive/2012/02/22/asp-net-web-forms-and-mvvm.aspx

Page 9: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

KnockoutJSOpen Source project developed

by Steve SandersonAn MVVM libraryCan bind HTML elements to a

JavaScript ViewModelInstall through NuGet

Page 10: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

ASP.NET Web API

“Stop looking at HTTP through the eyes of WCF”

More control over HTTPSimplifying configurationMore testabilityMultiple formats on a single

serviceOData support

Page 11: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Bundling and MinificationMust be enabled at

Application_StartCan bundle a whole directory

◦Alphabetical order ◦Known libraries are moved to top ◦Can be customized◦Minification can be skipped

Consider a NuGet package named “Cassette”◦http://getcassette.net/

Page 12: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Web SocketsBi-directional, full-duplex

communication channelOver a single TCP socketRequires implementation by both

web server and web browsers◦IIS 8◦IE 10

See sample

Page 13: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Small ImprovementsHTML Encoded Data-Binding

◦Use <%#:◦More secured◦Not the default

Unobtrusive Validation◦Cleaner page◦Small page

HTML5 Updates◦TextBox.TextMode new values◦FileUpload supports multiple files

Page 14: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

IDE EnhancementsHTML EditorJavaScript EditorCSS EditorPage InspectorPublishingIIS Express

Page 15: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

HTML EditorSmart Tasks inside source viewNew HTML5 snippetsExtract to user controlIntelliSense inside attributesAutomatic renaming of matching tagEvent Handler generationSmart indentationAuto reduce statement completionRefactoring effects markup too

Page 16: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

JavaScript EditorCode outliningBrace MatchingGo to definitionImplicit referencesDOM IntelliSense

Page 17: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

CSS EditorHierarchical indentationIntellisense for CSS HacksCtrl+K,CColor pickerVendor specific prefixesSnippets for browser specific

settings

Page 18: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Page InspectorDetermine which server-side code has produced the HTML markup

Install through Web Platform InstallerRight click a file and select “View in

Page Inspector”Renders web pages directly into

visual studioAllows you to examine source code

and HTML

Page 19: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

More IDE EnhancementsBrowser chooser

◦MultipleImage Thumbnails

Page 20: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

ASP.NET MVC – Brief Overview

View Controller Routing System

Extensibility

Partial View

Action Route Model Metadata

HTML Helper

Filter Route Handler

Value Provider

Inline Template

Model State

Constraint Model Binder

Razor Method Selector

Temp Data Provider

View Bag Temp Data Dependency Resolver

View Engine

Action Result

Page 21: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

ASP.NET MVC 4New Project TemplatesBetter Mobile SupportDisplay Modes and View SwitcherRecipesTask Support for Asynchronous

Controllers

Page 22: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Project TemplatesDefault Project Template

◦Modern looking◦Richer UI through jQuery UI dialog◦Adaptive Rendering

Mobile◦ Incorporate jQuery Mobile scripts

Single Page Application◦ Integrates upshot & Knockout◦Come to next session

Web API

Page 23: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Better Mobile SupportAdaptive RenderingDisplay ModesView SwitcherMobile Template Project

Page 24: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Display ModesUseful when adding mobile support

for existing web site◦Install-Package jQuery.Mobile.MVC

Allows view/layout selection depending on the browser

Can override current browser “User Agent String”◦Can be used to implement a “View

Switcher”Can register custom display modes

Page 25: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

JQM – Server vs. Client centric

JQM can be used for both type of application

The challenge is to create a real Mobile/Web application◦Need to preload all application views◦Views should be filled by client code

KnockoutJS

◦What if server is down? HTML5 Offline Web Applications

Page 26: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

SummaryASP.NET Web Forms

◦New data binding mechanismASP.NET MVC 4

◦Better mobile supportVisual Studio

◦Better JavaScript development support

◦Lots of nice/small improvements

Page 27: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Read moreCourse 1373 at John Bryce

http://weblogs.asp.net/scottgu/http://www.hanselman.com/blog/http://www.asp.net/mvchttp://jquery.com/http://jquerymobile.com/http://blogs.microsoft.co.il/blogs/

oric/

Page 28: What’s New in ASP.NET 4.5 Ori Calvo, 2012 John Bryce Hi-Tech College Ori.calvo@gmail.com

Thank You !!!