51
WebMatrix: See What the Matrix Can Do For You!! Frederic Harper Developer Evangelist Microsoft Canada DevTeach Ottawa

DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

WebMatrix: See What the

Matrix Can Do For You!! Frederic Harper

Developer Evangelist

Microsoft Canada

DevTeach Ottawa

Page 2: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Agenda

• What is WebMatrix?

• Who is WebMatrix for?

• Razor syntax

• Database access

• Helpers

• App Gallery & OSS Apps

Page 3: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

My goals

Page 4: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

My goals

Page 5: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

My goals

1. Show you how it’s easy to use WebMatrix to

create awesome websites or Web applications

Page 6: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

WebMatrix

Page 7: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What is WebMatrix

It’s a free tool that makes it easy to

Create

Configure

Publish your websites and web applications

Page 8: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What is WebMatrix

1. Web App Gallery & Templates

Page 9: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What is WebMatrix

1. Web App Gallery & Templates

2. Web Server: IIS Express

Page 10: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. Web App Gallery & Templates

2. Web Server: IIS Express

3. Standards Support: HTML, CSS, JavaScript

What is WebMatrix

Page 11: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What is WebMatrix

1. Web App Gallery & Templates

2. Web Server: IIS Express

3. Standards Support: HTML, CSS, JavaScript

4. Scripting Support: ASP.NET & PHP

Page 12: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What is WebMatrix

1. Web App Gallery & Templates

2. Web Server: IIS Express

3. Standards Support: HTML, CSS, JavaScript

4. Scripting Support: ASP.NET & PHP

5. DB Manager: SQL Server & MySQL

Page 13: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What is WebMatrix

1. Web App Gallery & Templates

2. Web Server: IIS Express

3. Standards Support: HTML, CSS, JavaScript

4. Scripting Support: ASP.NET & PHP

5. DB Manager: SQL Server & MySQL

6. Optimization Tools: SEO & Performance

Page 14: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

demo A lap around WebMatrix

Page 15: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Who is WebMatrix for?

I <3 Web Apps. I just need a tool that makes them easier to configure, customize

and publish

I want to build web sites myself with an easy to learn tool and framework

I’m a professional software developer and I build complex, large scale web sites

with a team of developers

Page 16: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Two ways to build

Page 17: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Two ways to build

Option A: From Scratch

Page 18: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Two ways to build

Option A: From Scratch

Option B: From Web App

Page 19: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

demo Create a website from template

Page 20: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Razor

Page 21: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What is Razor

Page 22: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. A new view engine

What is Razor

Page 23: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. A new view engine

2. Compact, Expressive, and Fluid

What is Razor

Page 24: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. A new view engine

2. Compact, Expressive, and Fluid

3. Easy to Learn

What is Razor

Page 25: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. A new view engine

2. Compact, Expressive, and Fluid

3. Easy to Learn

4. Is not a new language

What is Razor

Page 26: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. A new view engine

2. Compact, Expressive, and Fluid

3. Easy to Learn

4. Is not a new language

5. Works with any Text Editor

What is Razor

Page 27: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. A new view engine

2. Compact, Expressive, and Fluid

3. Easy to Learn

4. Is not a new language

5. Works with any Text Editor

6. Has great Intellisense

What is Razor

Page 28: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

1. A new view engine

2. Compact, Expressive, and Fluid

3. Easy to Learn

4. Is not a new language

5. Works with any Text Editor

6. Has great Intellisense

7. Unit Testable

What is Razor

Page 29: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Introducing Razor <ul>

<% for (int i = 0; i < 10; i++) { %>

<li><% =i %></li>

<% } %>

</ul>

Web Forms (6 transitions):

PHP (2 transitions & an echo):

Razor (2 transitions):

<ul>

<?php

for ($i = 0; $i < 10; $i++) {

echo("<li>$i</li>");

}

?>

</ul>

<ul>

@for (int i = 0; i < 10; i++) {

<li>@i</li>

}

</ul>

Page 30: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Code to markup easily @{

var name = “John Doe”;

<div>

Your name: @name

</div>

}

Option 1: HTML Block

Option 2: Text Block

Option 3: Single line of output

in markup

@{

var name = “John Doe”;

<text>

Your name: @name

</text>

}

@{

var name = “John Doe”;

@: Your name: @name

}

Page 31: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Commenting @*

<div>

Hello World

</div>

*@

Option 1: Markup

Option 2: Code

Option 3: Both

@{

//var name = "John Doe”;

//@name

}

@*

@{

//var name = "John Doe";

//@name

}

*@

Page 32: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

demo Simple Razor syntax demo

Page 33: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Database

Page 34: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Database

• SQL Compact Edition

• File-based, so it’s portable. Runs without a server.

• Easy to design, easy to code against

Designing

@{

var db = Database.Open("ArtGallery");

var product = db.Query("SELECT * FROM PRODUCTS);

}

Coding

Page 35: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

demo Database access

Page 36: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Helpers

Page 37: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

What are Helpers?

Helpers make it easy to quickly add commonly used functionality into your websites

and many more…

Page 38: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Two categories

HTML Helpers

• Facebook

• Twitter

• …

Make is faster and easier to render commonly used

markup to the page.

Make is faster and easier

to call complex APIs from

your website.

API Helpers

• PayPal

• Windows Azure Storage

• …

Page 39: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

demo Helpers

Page 40: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

App Gallery & OSS Apps

Page 41: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

OSS Apps

1. Free

2. Popular = large community

3. Gets you close to the solution quickly

4. Easy to configure

Page 42: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Build on the success of Web PI

Web Platform Installer WebMatrix

Download

Install (inc. dependencies)

Customize

SEO Analysis

Publish

Page 43: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

demo App Gallery & Wordpress in the box

Page 44: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Conclusion

Page 45: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Next steps

1. Install WebMatrix

Page 46: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Next steps

1. Install WebMatrix

2. Play with it

1. Create a new website with templates or from scratch

2. Edit an existing one

3. Deploy an app by using the App Gallery

Page 47: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Next steps

1. Install WebMatrix

2. Play with it

1. Create a new website with templates or from scratch

2. Edit an existing one

3. Deploy an app by using the App Gallery

3. Unleash the power of the Matrix & have fun

Page 48: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Resources

• http://microsoft.com/web/webmatrix

• http://asp.net/webmatrixresource (v1 tutorials)

• http://www.webnotwar.ca/

Page 49: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Q & A

Page 50: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

Contact me

Frederic Harper, Developer Evangelist

[email protected]

@fharper

http://webnotwar.ca

http://outofcomfortzone.net

Page 51: DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should

not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.