SlideShare a Scribd company logo
Build a WordPress Blog and
Photo Gallery Site in 60 Minutes!
          With WebMatrix




                                             Alice Pang
                           Developer Evangelist, Microsoft
                            http://blogs.msdn.com/alicerp
                                  http://twitter.com/alicerp
How WebMatrix Came About




 Web Server   Database   Development Tool
WebMatrix Users
     Peter                  Eric




                        I want to build a
 I need a blog, so I     web site for my
   need a tool that    photos with an easy
 makes it easier to     to learn tool and
configure, customize        framework
    and publish it.
Peter, the food blogger
Peter’s to-do’s
• set up a WordPress blog
• customize some settings
• Publish the blog
DEMO
    E   M

D
            O
Eric, the photographer
Eric’s to-do’s
•   set up a photo gallery site
•   customize with Razor syntax
•   Set up admin
•   Add Facebook helper
•   Publish the photo gallery site
Razor Syntax is Easy!
     Web Forms            <ul>
(6 markup transitions):     <% for (int i = 0; i < 10; i++) { %>
                              <li><% =i %></li>
                            <% } %>
                          </ul>


        PHP               <ul>
                            <?php
(2 markup transitions          for ($i = 0; $i < 10; $i++) {
     & an echo):                  echo("<li>$i</li>");
                               }
                            ?>
                          </ul>


       Razor              <ul>
                            @for (int i = 0; i < 10; i++) {
(2 markup transitions):       <li>@i</li>
                            }
                          </ul>
Commenting in Razor
            @*
              <div>
Option 1:       Hello World
Markup        </div>
            *@


            @{
              //var name = "John Doe”;
Option 2:     //@name
 Code       }


            @*
Option 3:     @{
                var name = "John Doe";
 Both           //@name
              }
            *@
Layouts make organizing your
        pages easier
 Don’t repeat yourself!
 Define one layout and use it across your website


                          Page 1


                                   Page 2
 Layout.cshtml


                          Page 3
Layout Syntax



/Shared/_Layout.cshtml
<html>
    <head>
      <title>Simple Layout</title>                        MyPage.cshtml
    </head>
                                @{
    <body>
                                   Layout = "/Shared/_Layout.cshtml";
        @RenderBody()
                                }
    </body>
</html>
                                <p>
                                   My content goes here
                                </p>
Use Sections to organize your
               pages
          Sections allow you to define areas of content that change
          between pages but need to be included in a layout

/Shared/_Layout.cshtml
                                                          MyPage.cshtml
<html>
    <head>                      @{
      <title>Simple Layout</title> Layout = "/Shared/_Layout.cshtml";
    </head>                     }
    <body>
        @RenderSection("Menu") @section Menu {
        @RenderBody()              <ul id="pageMenu">
    </body>                              <li>Option 1</li>
</html>                                  <li>Option 2</li>
                                   </ul>
                                }
                                <p>
                                   My content goes here
                                </p>
DEMO
    E   M

D
            O
What is Membership?
• Provides registration for users
• Organize users into roles
• Restrict access to pages on your website
  based on user or role

Some templates include Admin folder with all the pages
required for membership
Setting up Membership
• Set up membership in one line of code

 /_AppStart.cshtml
  @{
     WebSecurity.InitializeDatabaseConnection("StarterSite", "UserProfile", "UserId", "Email",
  true);
  }

  StarterSite database
DEMO
    E   M

D
            O
What are Helpers?
• Helpers make it easy to quickly add commonly used
  functionality into your websites
• Helpers are designed to make your life easier
• Some examples:
   –   Facebook
   –   Twitter
   –   PayPal
   –   UserVoice
   –   OData
   –   Windows Azure Storage
   –   And many more…
Two categories of Helpers
You can think of Helpers like this:
                Make is faster and easier to render
                commonly used markup to the page.
 HTML Helpers
                Examples: Facebook, Twitter




                Make is faster and easier to call
                complex APIs from your website.
  API Helpers   Examples: PayPal, OData, Windows
                Azure Storage
Make your website social
• Add social capabilities to your website with the
  WebMatrix Helper for Facebook
• There are many more helpers available for WebMatrix

   @FacebookSocialPlugins.Comments()
DEMO
    E   M

D
            O
Next Steps

Download it here:
   http://bit.ly/MSwebmatrix



• http://blogs.msdn.com/alicerp

More Related Content

PPTX
Joomla! Day Los Angeles 2011 WebMatrix
PDF
Fundamental JQuery
PPTX
Twitter bootstrap
PPTX
Introduction to jQuery Mobile
PPTX
18. images in symfony 4
PDF
Front-end Rails-приложений приложений, основанный на БЭМ
PDF
Advanced JQuery Mobile tutorial with Phonegap
PDF
Overview on jQuery mobile
Joomla! Day Los Angeles 2011 WebMatrix
Fundamental JQuery
Twitter bootstrap
Introduction to jQuery Mobile
18. images in symfony 4
Front-end Rails-приложений приложений, основанный на БЭМ
Advanced JQuery Mobile tutorial with Phonegap
Overview on jQuery mobile

What's hot (20)

PPTX
Introduction to the jQuery mobile framework
PPTX
Introduction to jquery mobile with Phonegap
PPT
An Introduction to Drupal
PPT
jQuery Mobile with HTML5
PPT
Introduction to ZendX jQuery
PDF
How To Write Your First Firefox Extension
PPTX
Firefox addons
PPT
Architecture of Drupal - Drupal Camp
PDF
jQuery Mobile: Progressive Enhancement with HTML5
PPTX
Firefox Extension Development
PDF
WebComponents or shadow side of the Doom
ZIP
Drupal Development
PPTX
Bootstrap webtech presentation - new
PDF
Firefox extension Development
PPTX
WordPress Theme Development
PDF
Bootstrap Workout 2015
PPT
jQuery Tips Tricks Trivia
PDF
Installing And Configuration for your Wordpress blog
PDF
Front end workflow Presentation at Coffee@DBG by Praveen Vijayan
PPTX
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
Introduction to the jQuery mobile framework
Introduction to jquery mobile with Phonegap
An Introduction to Drupal
jQuery Mobile with HTML5
Introduction to ZendX jQuery
How To Write Your First Firefox Extension
Firefox addons
Architecture of Drupal - Drupal Camp
jQuery Mobile: Progressive Enhancement with HTML5
Firefox Extension Development
WebComponents or shadow side of the Doom
Drupal Development
Bootstrap webtech presentation - new
Firefox extension Development
WordPress Theme Development
Bootstrap Workout 2015
jQuery Tips Tricks Trivia
Installing And Configuration for your Wordpress blog
Front end workflow Presentation at Coffee@DBG by Praveen Vijayan
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
Ad

Viewers also liked (12)

PPT
Ten principles
PPT
David Deschaine Roofing Presentation
PPTX
Brief Intro Statistics
PPT
Pkn klpk 1,
TXT
Dados morfológicos do catálago Frei (1996)
PPT
Reinforcement learning
PPTX
Migliaccio unit5 powerpoint
PPTX
Fotografia
PPT
Noi
DOC
Ke pala surat ( black metal )
PPTX
8 things you should stop doing
PPT
Reinforcement learning
Ten principles
David Deschaine Roofing Presentation
Brief Intro Statistics
Pkn klpk 1,
Dados morfológicos do catálago Frei (1996)
Reinforcement learning
Migliaccio unit5 powerpoint
Fotografia
Noi
Ke pala surat ( black metal )
8 things you should stop doing
Reinforcement learning
Ad

Similar to WebMatrix 100-level presentation (20)

PPTX
J day la 2011 webmatrix
PPTX
Intro to MVC 3 for Government Developers
PDF
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!
PPTX
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
PPTX
Introduction towebmatrix
PDF
WebMatrix, see what the matrix can do for you!!
PDF
Asp.net w3schools
PPTX
Intro to .NET for Government Developers
PPTX
Asp.net With mvc handson
PPTX
Web matrix part 2
PPTX
Microsoft Web Matrix
PPTX
Views
PPTX
Microsoft WebMatrix Platform Overview
PPTX
PDF
ASP.NET MVC 3
PPTX
Mvc summary
PPTX
MVC & SQL_In_1_Hour
DOC
.NET 1.1 Base Page Framework Article
DOCX
Master page
PPTX
Branding & Design Opportunities/Challenges with SharePoint 2013
J day la 2011 webmatrix
Intro to MVC 3 for Government Developers
DevTeach Ottawa - Webmatrix, see what the matrix can do for you!!
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
Introduction towebmatrix
WebMatrix, see what the matrix can do for you!!
Asp.net w3schools
Intro to .NET for Government Developers
Asp.net With mvc handson
Web matrix part 2
Microsoft Web Matrix
Views
Microsoft WebMatrix Platform Overview
ASP.NET MVC 3
Mvc summary
MVC & SQL_In_1_Hour
.NET 1.1 Base Page Framework Article
Master page
Branding & Design Opportunities/Challenges with SharePoint 2013

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Electronic commerce courselecture one. Pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Modernizing your data center with Dell and AMD
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
NewMind AI Weekly Chronicles - August'25 Week I
Electronic commerce courselecture one. Pdf
Machine learning based COVID-19 study performance prediction
20250228 LYD VKU AI Blended-Learning.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Modernizing your data center with Dell and AMD
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
NewMind AI Monthly Chronicles - July 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Network Security Unit 5.pdf for BCA BBA.

WebMatrix 100-level presentation

  • 1. Build a WordPress Blog and Photo Gallery Site in 60 Minutes! With WebMatrix Alice Pang Developer Evangelist, Microsoft http://blogs.msdn.com/alicerp http://twitter.com/alicerp
  • 2. How WebMatrix Came About Web Server Database Development Tool
  • 3. WebMatrix Users Peter Eric I want to build a I need a blog, so I web site for my need a tool that photos with an easy makes it easier to to learn tool and configure, customize framework and publish it.
  • 4. Peter, the food blogger
  • 5. Peter’s to-do’s • set up a WordPress blog • customize some settings • Publish the blog
  • 6. DEMO E M D O
  • 8. Eric’s to-do’s • set up a photo gallery site • customize with Razor syntax • Set up admin • Add Facebook helper • Publish the photo gallery site
  • 9. Razor Syntax is Easy! Web Forms <ul> (6 markup transitions): <% for (int i = 0; i < 10; i++) { %> <li><% =i %></li> <% } %> </ul> PHP <ul> <?php (2 markup transitions for ($i = 0; $i < 10; $i++) { & an echo): echo("<li>$i</li>"); } ?> </ul> Razor <ul> @for (int i = 0; i < 10; i++) { (2 markup transitions): <li>@i</li> } </ul>
  • 10. Commenting in Razor @* <div> Option 1: Hello World Markup </div> *@ @{ //var name = "John Doe”; Option 2: //@name Code } @* Option 3: @{ var name = "John Doe"; Both //@name } *@
  • 11. Layouts make organizing your pages easier Don’t repeat yourself! Define one layout and use it across your website Page 1 Page 2 Layout.cshtml Page 3
  • 12. Layout Syntax /Shared/_Layout.cshtml <html> <head> <title>Simple Layout</title> MyPage.cshtml </head> @{ <body> Layout = "/Shared/_Layout.cshtml"; @RenderBody() } </body> </html> <p> My content goes here </p>
  • 13. Use Sections to organize your pages Sections allow you to define areas of content that change between pages but need to be included in a layout /Shared/_Layout.cshtml MyPage.cshtml <html> <head> @{ <title>Simple Layout</title> Layout = "/Shared/_Layout.cshtml"; </head> } <body> @RenderSection("Menu") @section Menu { @RenderBody() <ul id="pageMenu"> </body> <li>Option 1</li> </html> <li>Option 2</li> </ul> } <p> My content goes here </p>
  • 14. DEMO E M D O
  • 15. What is Membership? • Provides registration for users • Organize users into roles • Restrict access to pages on your website based on user or role Some templates include Admin folder with all the pages required for membership
  • 16. Setting up Membership • Set up membership in one line of code /_AppStart.cshtml @{ WebSecurity.InitializeDatabaseConnection("StarterSite", "UserProfile", "UserId", "Email", true); } StarterSite database
  • 17. DEMO E M D O
  • 18. What are Helpers? • Helpers make it easy to quickly add commonly used functionality into your websites • Helpers are designed to make your life easier • Some examples: – Facebook – Twitter – PayPal – UserVoice – OData – Windows Azure Storage – And many more…
  • 19. Two categories of Helpers You can think of Helpers like this: Make is faster and easier to render commonly used markup to the page. HTML Helpers Examples: Facebook, Twitter Make is faster and easier to call complex APIs from your website. API Helpers Examples: PayPal, OData, Windows Azure Storage
  • 20. Make your website social • Add social capabilities to your website with the WebMatrix Helper for Facebook • There are many more helpers available for WebMatrix @FacebookSocialPlugins.Comments()
  • 21. DEMO E M D O
  • 22. Next Steps Download it here: http://bit.ly/MSwebmatrix • http://blogs.msdn.com/alicerp

Editor's Notes

  • #3: WebMatrix evolved from a number of things that Microsoft was working on, including IIS Developer Express, SQL Server CE, and ASP.NET Razor syntax. Razor syntax is an easy way to mix HTML and code like C# and VB, but it’s also used on other platforms such as MVC. File extensions are .cshtml and .vbhtml
  • #4: Introduce two users: (1) the foodie who wants to get a food recipes and food adventures blog up quickly and easily by using the app gallery and (2) the photographer who wants to be more hands-on with customizing his site
  • #6: We’re going to help Peter do these three things. We will show him how to customize in WordPress and with PHP code in WebMatrix. We’ll also show off some cool PHP IntelliSense in the process.
  • #7: Set up WordPress blog, change theme, PHP customization, publish: http://blogs.msdn.com/b/alicerp/archive/2011/09/30/get-your-wordpress-blog-up-and-running-and-customize-it-in-25-minutes.aspx
  • #8: Moving on to the photographer
  • #9: We will set up a photo gallery site from the template, introduce ASP.NET Razor syntax and add a Page Footer with Razor syntax, set up administrator role and use Razor to restrict access to a page, add a Facebook (or Twitter) helper through both the NuGet gallery and ASP.NET Web Pages administration, publish
  • #10: Reduces the number of keystrokes and is intuitive for programmers.
  • #11: 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.
  • #13: Inject code, like ASP.NET Master Pages
  • #15: Create photo gallery, show off reports, UI in WebMatrix, add photo/comment/user account to show off databases, create new file for PageFooterhttp://blogs.msdn.com/b/alicerp/archive/2011/10/13/create-a-consistent-look-to-your-website-and-get-started-with-asp-net-razor-syntax-by-adding-a-page-footer.aspx
  • #17: The StarterSite Template comes with membership configured, and with a Database ready to be filled with users as well as their roles in the website.First, you have to uncomment the WebSecurity.InitializeDatabaseConnection and fill the parameters with a userProfile and userId to be defined in the database.
  • #18: Show off reCaptcha.net code that is added but commented out by default in this template, add administrator role, assign user to this role, and create an AdminOnly and AdminError page to restrict access.http://blogs.msdn.com/b/alicerp/archive/2011/10/30/membership-roles-made-easy-with-razor-syntax-in-webmatrix.aspx
  • #19: WebMatrix Helpers help you add common functionality to your Web site. They can be used to solve a specific web site tasks. You can think of them as bricks that are used/reused and interconnected to build a site. Nothing stops you from creating a helper and reusing it on different pages of your site, or even in different sites. And you can use helpers created by others. Here is a sample of existing helpers.
  • #20: HTML Helpers focus in look &amp; feel and simple connection with other sites, like Facebook and Twitter.API Helpers are more complex helpers, conceived to interact with external services. Their focus is not based on the user interface, but the service integrity, for instance how to secure a transaction in PayPal or registering an order to update your storage in a Windows Azure Account.
  • #21: If people like something on your site, they often want to share it with friends. For instance, to comment on Facebook, you can download the FacebookSocialHelper and then add the @FacebookSocialPlugins.Comments() in your page to show the Facebook comments’ controls.
  • #22: Show adding helper from both NuGet gallery and ASP.NET web pages administration. Add Facebook, Twitter, or your favorite helper and demonstrate how easy it is to use Razor and IntelliSense to add a helper and show that the packages is automatically populated when you add a helper. http://blogs.msdn.com/b/alicerp/archive/2011/10/13/make-your-website-more-social-with-helpers.aspx