23

Learning WebMatrix: Part 1 of 3

  • Upload
    tommy

  • View
    40

  • Download
    2

Embed Size (px)

DESCRIPTION

Learning WebMatrix: Part 1 of 3. Akber Alwani http://twitter.com/epdotnet. You are a Web Camper!. Congratulations! Y ou are part of a global community of thousands of web developers who attend Web Camps to keep their web development skills up-to-date - PowerPoint PPT Presentation

Citation preview

Page 1: Learning WebMatrix:  Part 1 of 3
Page 2: Learning WebMatrix:  Part 1 of 3

Learning WebMatrix: Part 1 of 3Akber Alwani http://twitter.com/epdotnet

Page 3: Learning WebMatrix:  Part 1 of 3

Congratulations! You are part of a global community of thousands of web developers who attend Web Camps to keep their web development skills up-to-date Web Camps are run all over the world in 6 continents, 30 countries Join the community!

Facebook Fan Page (search for Web Camps)Follow @Webcamps on Twitter

Find out more about events here: www.webcamps.ms

You are a Web Camper!

Page 4: Learning WebMatrix:  Part 1 of 3

Today’s decks, demos and labs are available at www.webcamps.ms (click on Web Camps Training Kit)Plus, there’s also content on

ASP.NET MVC 3HTML5 and IE9jQueryWeb Apps!

It’s all FREE!

Where do I get this content?

Page 5: Learning WebMatrix:  Part 1 of 3

Part 1What is WebMatrix?Razor SyntaxDatabase AccessWebGrid

Part 2LayoutsHelpers

Themes, Package Manager, Facebook and moreMembershipRouting

Part 3Building HelpersWebMatrix and OSS Web AppsPublishing your website or web appHow to “grow up” to Visual Studio 2010 and ASP.NET MVC

Agenda

Page 6: Learning WebMatrix:  Part 1 of 3

Introducing WebMatrix

Customize PublishCreate

Page 7: Learning WebMatrix:  Part 1 of 3

Introducing WebMatrix

Web Server Database Development Tool

Page 8: Learning WebMatrix:  Part 1 of 3

What it actually consists of

Templates

Web Server: IIS Express

Database: SQL Server Compact/MySQL

Web App Gallery

Programming Framework: ASP.NET/PHP

http://go.microsoft.com/fwlink/?LinkID=205867

Page 9: Learning WebMatrix:  Part 1 of 3

Who is WebMatrix for?

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

and publish them

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

WebMatrix WebMatrix

Visual Studio 2010

Page 12: Learning WebMatrix:  Part 1 of 3

A LAP AROUND WEBMATRIX

Demonstration

Page 13: Learning WebMatrix:  Part 1 of 3

The easiest way to code websitesEasy to mix HTML and CodeLots of useful Helpers

Introducing Razor

Page 14: Learning WebMatrix:  Part 1 of 3

Razor is a cut above the rest

<ul> <% for (int i = 0; i < 10; i++) { %> <li><% =i %></li> <% } %></ul>

<ul> @for (int i = 0; i < 10; i++) { <li>@i</li> }</ul>

Razor (2 markup transitions):

Web Forms (6 markup transitions):

<ul> <?php for ($i = 0; $i < 10; $i++) { echo("<li>$i</li>"); } ?></ul>

PHP(2 markup transitions

& an echo):

Page 15: Learning WebMatrix:  Part 1 of 3

Move from code to markup easily with Razor

@{ var name = “John Doe”; <div> Your name: @name </div>}

@{ var name = “John Doe”; @: Your name: @name}

Option 3:Single line of output

in markup

Option 1:HTML Block

@{ var name = “John Doe”; <text> Your name: @name </text>}

Option 2:Text Block

Page 16: Learning WebMatrix:  Part 1 of 3

Commenting in Razor@* <div> Hello World </div>*@

@* @{ var name = "John Doe"; @name }*@

Option 3:Both

Option 1:Markup

@{ //var name = "John Doe”; //@name}

Option 2:Code

Page 17: Learning WebMatrix:  Part 1 of 3

RAZOR SYNTAXDemonstration

Page 18: Learning WebMatrix:  Part 1 of 3

SQL Compact EditionFile-based, so it’s portable. Runs without a server.

Easy to design, easy to code against

Database

Designing

@{ var db = Database.Open("ArtGallery"); var product = db.Query("SELECT * FROM PRODUCTS); }

Coding

Page 19: Learning WebMatrix:  Part 1 of 3

DATABASE ACCESSDemonstration

Page 20: Learning WebMatrix:  Part 1 of 3

Displays your data quickly and easilyLots of options to customize layout, appearance, paging etc.

Display your data easily with WebGrid

@{ var db = Database.Open("ArtGallery"); var data = db.Query("SELECT * FROM PRODUCTS);

var grid = new WebGrid(data);}

<div id="grid"> @grid.GetHtml();</div>

<div id="grid"> @grid.GetHtml( columns: grid.Columns( grid.Column("Name", "Product", style: "product"), grid.Column("Description", format:@<i>@item.Description</i>), grid.Column("Price", format:@<text>[email protected]</text>) ) )</div>

@{ var db = Database.Open("ArtGallery"); var data = db.Query("SELECT * FROM PRODUCTS); var grid = new WebGrid( source: data, defaultSort: "Name", rowsPerPage: 3);}

Page 21: Learning WebMatrix:  Part 1 of 3

WEBGRIDDemonstration

Page 22: Learning WebMatrix:  Part 1 of 3

What is WebMatrix?Razor SyntaxDatabase AccessWebGrid

Part 1 Summary

Page 23: Learning WebMatrix:  Part 1 of 3

Q&A