Introduction

Microsoft WebMatrix provides an easy way to get started with web development, and together with new Razor syntax for ASP.NET Web Pages it includes everything you need to get your web site up, running and integrated with many other sites and networks, in a short period of time. The WebMatrix helpers are designed to make your life easier when creating web sites. They provide you a simple and consistent way of performing common web development tasks that otherwise would require a great deal of custom coding. With a few lines of code you should be able to secure your web site using membership, store information in Windows Azure Storage, integrate your site with Facebook, among others things.

The Scribd Helper for WebMatrix allows you to easily add Scribd documents to your site. When the helper is in place, it interacts with the Scribd API and with Scribd Reader to easily list your documents, enabling users to view them without having to leave your site.

scribd-helper

Getting Started in 60 Seconds

The helper mainly consists of a Scribd.cshtml file, that should be placed in the App_Code folder of your WebMatrix site, together with a Scribd folder with some styles. To use the helper follow these steps:

  1. If you haven't got an Scribd account, sign up first.
  2. Once logged in, browse to your account settings page, and make note of your API key.
  3. Download the helper package and extract its content in the root folder of your WebMatrix site.
  4. Add the following line to the _AppStart.cshtml page of your WebMatrix site, replacing the placeholders with your Scribd API key.
    @{
        Scribd.Initialize(apiKey: "{your-api-key}");  
    }
  5. In any WebMatrix page, add the following line to display your Scribd documents:
    @Scribd.GetUserDocumentsWidget()

Documentation and Samples

Helper reference is available here. Optionally, you can download a sample WebMatrix web site where you can see the helper in action. To download and run it with Microsoft WebMatrix, follow these steps:

  1. Download the sample site from the Downloads section. Extract the contents and open the folder in WebMatrix.
  2. Configure your Scribd API key in the _AppStart.cshtml page.
  3. Run the sample! It contains code samples and examples of each feature provided by the helper.

Other Useful Resources

Don't miss the helper's getting started screencast.

You can find more information about the Scribd API in http://www.scribd.com/developers.

Learn more on WebMatrix, ASP.NET Web Pages and the Razor Syntax with the WebMatrix tutorials.

Last edited Dec 30, 2010 at 12:55 PM by jsenior, version 8