Upload
frederic-harper
View
696
Download
2
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
WebMatrix: See What the
Matrix Can Do For You!! Frederic Harper
Developer Evangelist
Microsoft Canada
Agenda
• What is WebMatrix?
• Who is WebMatrix for?
• Razor syntax
• Database access
• Helpers
• App Gallery & OSS Apps
My goals
My goals
My goals
1. Show you how it’s easy to use WebMatrix to
create awesome websites or Web applications
WebMatrix
What is WebMatrix
It’s a free tool that makes it easy to
Create
Configure
Publish your websites and web applications
What is WebMatrix
1. Web App Gallery & Templates
What is WebMatrix
1. Web App Gallery & Templates
2. Web Server: IIS Express
1. Web App Gallery & Templates
2. Web Server: IIS Express
3. Standards Support: HTML, CSS, JavaScript
What is WebMatrix
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
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
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
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
Two ways to build
Two ways to build
Option A: From Scratch
Two ways to build
Option A: From Scratch
Option B: From Web App
demo A lap around WebMatrix
Razor
What is Razor
1. A new view engine
What is Razor
1. A new view engine
2. Compact, Expressive, and Fluid
What is Razor
1. A new view engine
2. Compact, Expressive, and Fluid
3. Easy to Learn
What is Razor
1. A new view engine
2. Compact, Expressive, and Fluid
3. Easy to Learn
4. Is not a new language
What is Razor
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
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
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
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>
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
}
Commenting @*
<div>
Hello World
</div>
*@
Option 1: Markup
Option 2: Code
Option 3: Both
@{
//var name = "John Doe”;
//@name
}
@*
@{
//var name = "John Doe";
//@name
}
*@
demo Razor syntax
Database
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
demo Database access
Helpers
What are Helpers?
Helpers make it easy to quickly add commonly used functionality into your websites
and many more…
Two categories
HTML Helpers
• …
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
• …
demo Helpers
App Gallery & OSS Apps
OSS Apps
1. Free
2. Popular = large community
3. Gets you close to the solution quickly
4. Easy to configure
Build on the success of Web PI
Web Platform Installer WebMatrix
Download
Install (inc. dependencies)
Customize
SEO Analysis
Publish
demo App Gallery
Conclusion
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
Resources
• http://microsoft.com/web/webmatrix
• http://asp.net/webmatrixresource (v1 tutorials)
• http://www.webnotwar.ca/
Remember To Complete Your Evaluations!
You could WIN a Samsung Focus Windows Phone 7!
Let us know what you liked & disliked!
Remember, 1=Bad, 5=Good
Please provide comments! No purchase necessary. The contest is open to residents of Canada (excluding government employees). The Toronto Tech·Days evaluation form contest begins on October 25th, 2011 and ends on October 26th, 2011. The Vancouver Tech·Days evaluation form contest begins on November 15th, 2011 and ends on November 16th, 2011. The Montreal Tech·Days evaluation form contest begins on November 29th, 2011 and ends on November 30th, 2011. Participants can enter the contest in one of two ways: (1) complete and submit an evaluation form by the contest close date; or (2) provide contact information by the contest close date. The draw for Toronto will take place on October 31st, 2011. The draw for Vancouver will take place on November 21st, 2011. The draw for Montreal will take place on December 5th, 2011. The chances of being selected depend upon the number of eligible entries. Selected participants will be contacted by phone and/or e-mail and will be required to answer correctly a time-limited skill-testing question. There are three (3) prizes available to be won. One (1) prize will be given away for each Tech·Days event in Toronto (October 25-26 2011), Vancouver (November 15-16 2011) and Montreal (November 29-30 2011). The prize consists of a Samsung Focus Windows Phone 7 (handset only; voice and/or data plan not included) (approximate retail value of $499 CAD). The prize will be delivered to the shipping address designated by the winner within 6-8 weeks. The winner may be required to sign a declaration and release form. For full contest rules, please see a Microsoft Tech·Days representative.
You can email any additional comments directly to [email protected] at any time.
Q & A
Contact me
Frederic Harper, Developer Evangelist
@fharper
http://webnotwar.ca
http://outofcomfortzone.net
© 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.