SlideShare una empresa de Scribd logo
1 de 19
Build Your Own
Real World Websites With Matrix
Saurabh is a Microsoft alumnus and one of the first 500
professionals around the world to be awarded Microsoft Most
Valuable Professional (Visual C#), MCT.NET, MCTS(Windows/Web),
MCSD.NET, MCAD.NET and MCDBA (Microsoft Certified Professional since 1998)
• What is WebMatrix?
• Razor Syntax
• Database Access
• WebGrid
Customize PublishCreate
Web Server Database Development Tool
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
A Lap around
The magic of Web Matrix
• The easiest way to code websites
• Easy to mix HTML and Code
• Lots of useful Helpers
<ul>
<% for (int i = 0; i < 10; i++) { %>
<li><% =i %></li>
<% } %>
</ul>
WEB FORMS
6markup transitions
<ul>
<?php
for ($i = 0; $i < 10; $i++) {
echo("<li>$i</li>");
}
?>
</ul>
PHP
2markup
transitions
1display
echo
<ul>
@for (int i = 0; i < 10; i++) {
<li>@i</li>
}
</ul>
RAZOR
2markup transitions
@{
var name = “John Doe”;
<div>
Your name: @name
</div>
}
OPTION 1
HTML block
@{
var name = “John Doe”;
<text>
Your name: @name
</text>
}
OPTION 2
TEXT block
@{
var name = “John Doe”;
@: Your name: @name
}
OPTION 3
SINGLE line
@*
<div>
Hello World
</div>
*@
OPTION 1
MARKUP
@{
//var name = "John Doe”;
//@name
}
OPTION 2
CODE
@*
@{
var name = "John Doe";
@name
}
*@
OPTION 3
BOTH
Razor Syntax
Experience the change
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
Database Access
Let’s create our first database
Displays your data quickly and easily
Lots of options to customize layout, appearance, paging etc.
@{
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>$@item.Price</text>)
)
)
</div>
@{
var db = Database.Open("ArtGallery");
var data = db.Query("SELECT * FROM PRODUCTS);
var grid = new WebGrid(
source: data,
defaultSort: "Name",
rowsPerPage: 3);
}
Display Data
Using WebGrid
• What is WebMatrix?
• Razor Syntax
• Database Access
• WebGrid
get the latest at
http://www.facebook.com/ysaurabh
follow me at
http://www.twitter.com/ysaurabh

Más contenido relacionado

La actualidad más candente

Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB AppHenrik Ingo
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRailsMike Dirolf
 
When dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWhen dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWim Godden
 
Dojo, from scratch to result
Dojo, from scratch to resultDojo, from scratch to result
Dojo, from scratch to resultNikolai Onken
 
Website trends 2012 presentation
Website trends 2012 presentationWebsite trends 2012 presentation
Website trends 2012 presentationFresh_Egg
 
CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11virtualsciences41
 
Html part 2
Html part 2Html part 2
Html part 2lokenra
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseSudhir Patil
 
Introducing DynaTrace AJAX Edition
Introducing DynaTrace AJAX EditionIntroducing DynaTrace AJAX Edition
Introducing DynaTrace AJAX EditionKyoungtaek Koo
 
Mongodb open data day 2014
Mongodb open data day 2014Mongodb open data day 2014
Mongodb open data day 2014David Green
 

La actualidad más candente (11)

Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB App
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
When dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWhen dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniques
 
Dojo, from scratch to result
Dojo, from scratch to resultDojo, from scratch to result
Dojo, from scratch to result
 
Html5 use cases
Html5 use casesHtml5 use cases
Html5 use cases
 
Website trends 2012 presentation
Website trends 2012 presentationWebsite trends 2012 presentation
Website trends 2012 presentation
 
CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11CT presentatie JQuery 7.12.11
CT presentatie JQuery 7.12.11
 
Html part 2
Html part 2Html part 2
Html part 2
 
MongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql DatabaseMongoDB Introduction - Document Oriented Nosql Database
MongoDB Introduction - Document Oriented Nosql Database
 
Introducing DynaTrace AJAX Edition
Introducing DynaTrace AJAX EditionIntroducing DynaTrace AJAX Edition
Introducing DynaTrace AJAX Edition
 
Mongodb open data day 2014
Mongodb open data day 2014Mongodb open data day 2014
Mongodb open data day 2014
 

Similar a Microsoft Web Matrix

Intro to MVC 3 for Government Developers
Intro to MVC 3 for Government DevelopersIntro to MVC 3 for Government Developers
Intro to MVC 3 for Government DevelopersFrank La Vigne
 
Introduction towebmatrix
Introduction towebmatrixIntroduction towebmatrix
Introduction towebmatrixPranav Ainavolu
 
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...Frédéric Harper
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government DevelopersFrank La Vigne
 
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!Frédéric Harper
 
WebMatrix, see what the matrix can do for you!!
WebMatrix, see what the matrix can do for you!!WebMatrix, see what the matrix can do for you!!
WebMatrix, see what the matrix can do for you!!Frédéric Harper
 
Web matrix part 2
Web matrix part 2Web matrix part 2
Web matrix part 2yuvaraj72
 
The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14Mark Rackley
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery GuideMark Rackley
 
WebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin WarrenerWebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin WarrenerSpiffy
 
Creating Flexible Data Services For Enterprise Soa With Wso2 Data Services
Creating Flexible Data Services For Enterprise Soa With Wso2 Data ServicesCreating Flexible Data Services For Enterprise Soa With Wso2 Data Services
Creating Flexible Data Services For Enterprise Soa With Wso2 Data Servicessumedha.r
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentationAlice Pang
 
A Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptA Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptSharePoint Saturday New Jersey
 
Web開発の技術選び、 好き嫌いでやってませんか 〜技術選びで注目すべきポイントとは〜
Web開発の技術選び、 好き嫌いでやってませんか  〜技術選びで注目すべきポイントとは〜Web開発の技術選び、 好き嫌いでやってませんか  〜技術選びで注目すべきポイントとは〜
Web開発の技術選び、 好き嫌いでやってませんか 〜技術選びで注目すべきポイントとは〜Yuki Okada
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery GuideMark Rackley
 

Similar a Microsoft Web Matrix (20)

Intro to MVC 3 for Government Developers
Intro to MVC 3 for Government DevelopersIntro to MVC 3 for Government Developers
Intro to MVC 3 for Government Developers
 
Introduction towebmatrix
Introduction towebmatrixIntroduction towebmatrix
Introduction towebmatrix
 
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!
 
WebMatrix, see what the matrix can do for you!!
WebMatrix, see what the matrix can do for you!!WebMatrix, see what the matrix can do for you!!
WebMatrix, see what the matrix can do for you!!
 
Web matrix part 2
Web matrix part 2Web matrix part 2
Web matrix part 2
 
The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
WebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin WarrenerWebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin Warrener
 
Creating Flexible Data Services For Enterprise Soa With Wso2 Data Services
Creating Flexible Data Services For Enterprise Soa With Wso2 Data ServicesCreating Flexible Data Services For Enterprise Soa With Wso2 Data Services
Creating Flexible Data Services For Enterprise Soa With Wso2 Data Services
 
CG_CS25010_Lecture
CG_CS25010_LectureCG_CS25010_Lecture
CG_CS25010_Lecture
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
WebMatrix 100-level presentation
WebMatrix 100-level presentationWebMatrix 100-level presentation
WebMatrix 100-level presentation
 
A Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptA Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with Javascript
 
Web開発の技術選び、 好き嫌いでやってませんか 〜技術選びで注目すべきポイントとは〜
Web開発の技術選び、 好き嫌いでやってませんか  〜技術選びで注目すべきポイントとは〜Web開発の技術選び、 好き嫌いでやってませんか  〜技術選びで注目すべきポイントとは〜
Web開発の技術選び、 好き嫌いでやってませんか 〜技術選びで注目すべきポイントとは〜
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery Guide
 

Último

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Último (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Microsoft Web Matrix

  • 1.
  • 2. Build Your Own Real World Websites With Matrix
  • 3. Saurabh is a Microsoft alumnus and one of the first 500 professionals around the world to be awarded Microsoft Most Valuable Professional (Visual C#), MCT.NET, MCTS(Windows/Web), MCSD.NET, MCAD.NET and MCDBA (Microsoft Certified Professional since 1998)
  • 4. • What is WebMatrix? • Razor Syntax • Database Access • WebGrid
  • 6. Web Server Database Development Tool
  • 7. 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
  • 8. A Lap around The magic of Web Matrix
  • 9. • The easiest way to code websites • Easy to mix HTML and Code • Lots of useful Helpers
  • 10. <ul> <% for (int i = 0; i < 10; i++) { %> <li><% =i %></li> <% } %> </ul> WEB FORMS 6markup transitions <ul> <?php for ($i = 0; $i < 10; $i++) { echo("<li>$i</li>"); } ?> </ul> PHP 2markup transitions 1display echo <ul> @for (int i = 0; i < 10; i++) { <li>@i</li> } </ul> RAZOR 2markup transitions
  • 11. @{ var name = “John Doe”; <div> Your name: @name </div> } OPTION 1 HTML block @{ var name = “John Doe”; <text> Your name: @name </text> } OPTION 2 TEXT block @{ var name = “John Doe”; @: Your name: @name } OPTION 3 SINGLE line
  • 12. @* <div> Hello World </div> *@ OPTION 1 MARKUP @{ //var name = "John Doe”; //@name } OPTION 2 CODE @* @{ var name = "John Doe"; @name } *@ OPTION 3 BOTH
  • 14. 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
  • 15. Database Access Let’s create our first database
  • 16. Displays your data quickly and easily Lots of options to customize layout, appearance, paging etc. @{ 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>$@item.Price</text>) ) ) </div> @{ var db = Database.Open("ArtGallery"); var data = db.Query("SELECT * FROM PRODUCTS); var grid = new WebGrid( source: data, defaultSort: "Name", rowsPerPage: 3); }
  • 18. • What is WebMatrix? • Razor Syntax • Database Access • WebGrid
  • 19. get the latest at http://www.facebook.com/ysaurabh follow me at http://www.twitter.com/ysaurabh

Notas del editor

  1. What WebMatrix is, who the intended users are for WebMatrix and what the Razor Syntax is. You will also learn how to access a database and how to use a WebGrid control to present its data in table format.
  2. 1 minute WebMatrix is a free tool that makes it really easy to create, configure and publish your web sites and web applications. It’s built on Microsoft’s in depth knowledge of web platforms, tools and frameworks and surfaced in a more approachable and straightforward way. As we go through the training you should keep these three main focus areas in your mind; create, customize and publish – we’ll be touching on them as we cover the different areas of WebMatrix.
  3. 1 minute WebMatrix comes with everything you need to get started building websites and web applications: A complete and integrated development environment, with a small download and a simple install. You get a database engine (SQL Server Compact Edition) to handle your data. All the structures you create in this database engine will be compatible with professional versions of SQL Server. WebMatrix supports a Web Server (IIS Express) to serve all your web pages. This web server is compatible with the professional versions of IIS as well. WebMatrix also comes with a new, simple programming framework that allows for rapid development of web sites and web applications. It supports Razor, the latest and simplified way to code web sites. It also provides a gallery of free open source applications to complement your development. It comes with an integrated installer that manages the heavy lifting of downloading and installing each component.
  4. 3 minutes When we look at all the different profiles of people creating websites we see certain patterns emerge. First, there’s a group of people that like to use the large number of rich web applications out there as a starting point, and then add some specific functionality. They need a quick and easy way to customize and publish their solutions. Many of these web applications are tailored for specific tasks like Content Management Systems or eCommerce websites. These developers will often repeat this process many times for each customer, their goal is to make the process of acquiring the application, customization and publishing it as quick as possible. A second group need to create web apps from scratch. These developers are hobbyists, beginners and people who need a tool that is easy to learn and that allows them to focus on the application functionality instead of developers’ details. Finally, the group of professional developers. They need a powerful tool, full of features and able to work in team, perhaps distributed ones. They will use a source and version control and will need a testing framework to write their own unit tests. This tool needs to support the addition of 3rd party powerful extensions. WebMatrix is built for those developers that like to start from scratch or by building from a 3rd party web applications.
  5. 1 minute When you create a new website from scratch in WebMatrix, you will be using the new Razor syntax. It’s very compact and easy to read and write, and allows you to flow between code and markup seamlessly. You can write your code in languages such as C# or VB, and it’s extensible via Helpers (we’ll talk about Helpers in Part 3)
  6. 2 minutes We’ve designed Razor to be concise and easy to use. When we think about the way developers use a language we take into account the context switching they have to do and also the number of keystrokes. The way that Razor allows you to transition seamlessly between markup and code makes for a much more natural and fluent style and also helps to reduce the number of keystrokes and context switching that a developer has to do, thinking about markup and code separately. With Razor, markup and code are really the same thing. We think it’s the easiest way to code websites and when you compare it to the other languages out there, it’s easy to see why.
  7. 1 minute The transition from code to markup is one of the most elegant things about Razor but there a few rules that are worth knowing about. Option 1: Code is the primary citizen in a code block, not HTML. This means the parser will always expect code unless it finds valid opening (and closing) tags. In the first option block you see that after the @{ a name variable is defined. No additional tag is necessary. A <div> section tells Razor that what follows should be taken as literal. Then the @name indicates a variable that needs to be replaced with its value. Option 2: Similarly, to explicitly call out text in a code block as HTML, wrap it in a <text> tag Option 3: Single line of output within markup can be denoted by @: This option is useful when you don’t want to render an HTML element as part of the output. Extra Knowledge (Advanced): The Parser that understands Razor is itself a standalone assembly (System.Web.Razor.dll) which has no dependencies on ASP.NET which means you can use it to parse CSHTML/VBHTML files and produce C#/VB code in any .NET application.
  8. 1 minute It’s always good practice to comment your code. In Razor we have the following options for commenting: Option 1: You can comment a block by using @* … *@ Please note that this method could not be recursive (you could not have a @* inside another @*) Option 2: You can comment lines by using // (in C#) the same way you do in your code files. Option 3: If you need to comment a whole razor block, you should add a @* before the beginning of the code block and a *@ after it’s finish.
  9. 5 minutes Syntax moving from code to markup ObjectInfo() ServerInfo()
  10. 2 minutes The database that comes with WebMatrix is SQL Compact Edition, or SQL CE for short. It’s free, lightweight and doesn’t require a separate server to run – which makes it much easier to get setup and running than traditional versions of SQL Server like SQL Server Express. SQL Compact Edition includes tools to manage your tables and data and because it’s file-based, you simply need to copy the database files to transport your database to another machine. This is really useful if you are sharing a database with another developer. This sample code shows how to connect to an ArtGallery Database and then perform a query with SQL to retrieve the ArtGallery products.
  11. 5 minutes Creating DB Designing DB Accessing DB using Razor (introduce URLData)
  12. 2 minutes As we’ve seen, the database design and access from Razor code in WebMatrix is easy. Often when we’re building websites, we’ll want to render data in some form of table. The WebGrid can help to make this easy to do. Build 1 In it’s simplest form, just give the WebGrid data and it will render it out in a valid HTML table. WebMatrix will make all the magic for you. But this has a few drawbacks: You’re not choosing the columns you want to show and they will be named as the field names in the database. Build 2 In the second sample, you explicitly state which columns to include in the WebGrid, their title (e.g.: «Product» instead of «Name») and how they will be formatted: Product column will use a CSS style, Description will appear in italic font, and so on. Build 3 In the last sample, you can see that we order the data by the «Name» column and by simply defining one parameter, we state that we want 3 rows per page. WebMatrix will do the rest for you.
  13. 5 minutes Build on previous data demo and place data in the WebGrid and render it. Add columns and paging.
  14. 1 minute We have learnt what is WebMatrix and who is it for. We had an overview Razor, a new way to code websites. We learned how to consume a database and how to display its data with a WebGrid Helper Finally, we have learned how to customize the data displayed in WebGrids.