html5 for asp.net developers

24
HTML5 and ASP.NET Justin Lee Software Development Consultant [email protected] http://justinlee.sg

Upload: justin-lee

Post on 20-Jan-2015

2.919 views

Category:

Technology


4 download

DESCRIPTION

HTML5 is the next wave of development for the web, with the support from IE9 and IE10. Even Windows 8 will support native apps written in HTML5. This session will give an overview and a deeper dive into writing effective HTML5 together with your existing ASP.NET experience to create the best next generation web experience.

TRANSCRIPT

Page 1: HTML5 for ASP.NET Developers

HTML5 and ASP.NET

Justin LeeSoftware Development Consultant

[email protected]://justinlee.sg

Page 2: HTML5 for ASP.NET Developers

HTML5

• HTML5 + Browser API + CSS3 + JavaScript

• New Elements and Attributes Markup

• New APIs for DOM• Video, Audio, 2D, 3D,

Animations, File, Drag-and-Drop, etc. support

Page 3: HTML5 for ASP.NET Developers
Page 4: HTML5 for ASP.NET Developers

CSS

2

CSS

3

Page 5: HTML5 for ASP.NET Developers
Page 6: HTML5 for ASP.NET Developers

HTM

L 4

HTM

L 5

Page 7: HTML5 for ASP.NET Developers

HTM

L 4

HTM

L 5

Page 8: HTML5 for ASP.NET Developers

Getting things set up

• Microsoft Visual Studio 2010 SP1• Web Standards Update for Microsoft Visual

Studio 2010 SP1• ASP.NET MVC3• NuGet

Page 9: HTML5 for ASP.NET Developers

Look! HTML5!

Page 10: HTML5 for ASP.NET Developers

NuGet Packages

• JQuery• Modernizr• HTML5.Setup• MvcHtml5Templates• MVCHtml5Toolkit• Html5Boilerplate.Mvc3.Razor

Page 11: HTML5 for ASP.NET Developers

Can I Use…

Page 12: HTML5 for ASP.NET Developers

HTML5 New Markups

• <!DOCTYPE html>• <header></header>, <section></section>,

<footer></footer>• <nav></nav>• New <input></input> attributes• <audio></audio>, <video></video>• <progress></progress>• <meter></meter>• Etc. etc. etc. etc. etc.

Page 13: HTML5 for ASP.NET Developers

HTML5 New Markups

Page 14: HTML5 for ASP.NET Developers

HTML5 New APIs

• Web Storage• Web Workers• Web Sockets• Notifications• Drag-and-Drop, Drag-in• Geolocation• Canvas• Etc. etc. etc. etc.

Page 15: HTML5 for ASP.NET Developers

HTML5 + CSS3• CSS Selectors• Webfonts• Text wrapping• Columns• Text Stroke• Opacity• HSL support• Rounded Corners• Gradients• Shadows• Border Image• Flexible Box Model• Transitions, Transforms, Animations• Etc. etc. etc. etc.

Page 16: HTML5 for ASP.NET Developers

CSS SelectorsSelectors.row:nth-child(even) { background: #dde;}.row:nth-child(odd) { background: white;}

Image-like displaydiv { display: inline-block;}

Specific attributesinput[type="text"] { background: #eee;}

Negation:not(.box) { color: #00c; } :not(span) { display: block; } More specific targettingh2:first-child { ... }

div.text > div { ... } h2 + header { ... }

Page 17: HTML5 for ASP.NET Developers

Web Fonts@font-face { font-family: 'LeagueGothic'; src: url(LeagueGothic.otf);}

@font-face { font-family: 'Droid Sans'; src: url(Droid_Sans.ttf);}

header { font-family: 'LeagueGothic';}

Page 18: HTML5 for ASP.NET Developers

HTML5 + JS

• document.getElementsByClassName, document.querySelectorAll

• Custom data-* attributes• Element.classList• History API• Etc. etc. etc. etc.

Page 19: HTML5 for ASP.NET Developers

HTML5 DEMOSDemos

Page 20: HTML5 for ASP.NET Developers

Futures for Visual Studio vNext

• Web Form will be HTML5 compatible• MVC and Razor will also support HTML5• Visual Studio Intellisense will have better JS

and CSS detection

Page 21: HTML5 for ASP.NET Developers

Tips

• Use ASP.NET MVC 3, not ASP.NET Web Forms (until ASP.NET 4.5)

• Use Modernizr to maintain backward compatibility

• Use Web Workers to maintain responsiveness

Page 22: HTML5 for ASP.NET Developers

Tips

• Consider carefully what should be processed Server-Side and Client-Side

• Not all browsers support all features (Especially IE)

• Learn the new markups, what you need might just be there.

Page 23: HTML5 for ASP.NET Developers

Useful Links

• Html5rocks.com• htmlfivewow.com• Caniuse.com• Supersocket.codeplex.com• Web Standards Update

Page 24: HTML5 for ASP.NET Developers

Q & A

Justin LeeSoftware Development Consultant

[email protected] http://justinlee.sg

Exploring new career opportunities