Logo
Lose Weight
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Azure

Managing BLOBs using the StorageClient library (part 1) - Listing BLOBs using the storage client

3/4/2011 11:53:20 AM
Now that you’ve finished your break and you’re rested enough to read this, let’s look at how you can use the StorageClient library to list BLOBs in a container, rather than using the REST API directly.

You developed a sample management application that would allow you to upload podcasts in an MP3 format that were ready to be converted to WMA. You made an ASP.NET page that displayed a grid of all the containers in your storage account. Included in the grid was a hyperlink that would redirect you to another page called blobs.aspx, passing in the name of the selected container in the query string. We’re going to extend that example now to develop the page blobs.aspx, shown in figure 1.

Figure 1. An ASP.NET web page that displays all the BLOBs that are in the selected container in a grid control


You can perform the following actions with the page shown in figure 9.4:

  • List all BLOBs in the selected container

  • Upload a new file

  • Delete an existing BLOB

  • Download an existing BLOB

Let’s look at each of these actions in detail.

1. Listing BLOBs using the storage client

In this section, we’ll look at how to generate the grid that displays the list of BLOBs. The following listing contains the markup required for the blobs.aspx page shown in figure 3 of this artilce.

Listing 1. ASPX page that lists the BLOBs in a container

At a GridView is displayed that lists all the BLOBs in its data source. At you’re defining a hyperlink button that you’ll use to download the BLOB, and at FileUpload control to upload the file. is the standard ASP.NET

The Code-Behind For the Web Page

You’ve defined how your web page will look. Now you need to bind the grid to the data source on page load. Listing 2 shows the code-behind required to display a list of BLOBs for the selected container in your grid.

Listing 2. Show the list of BLOBs in the grid


At you retrieve an instance of the BLOB container by calling the GetContainerReference method off the BLOB client. Notice that we’re passing in the container name from the request query string. Finally, you retrieve a list of the files held in the container by calling the ListBlobs method and binding the result to the GridView.

Now that you can list and display all of the BLOBs in the selected container, you need to extend the web page so that you can upload new files into the container.

Other -----------------
- Using the REST API (part 2) - Authenticating private requests
- Using the REST API (part 1) - Listing BLOBs in a public container using REST
- The basics of BLOBs - Configuring your application to work against the live service
- The basics of BLOBs : Developing against containers (part 3) - Listing containers & Deleting a container
- The basics of BLOBs : Developing against containers (part 2) - Creating a container
- The basics of BLOBs : Developing against containers (part 1) - Accessing the StorageClient library & Accessing development storage
- The basics of BLOBs : Getting started with development storage
- A closer look at the BLOB storage service
- Storing files in a scaled-out fashion is a pain in the NAS (part 2) - The BLOB service approach to file management
- Storing files in a scaled-out fashion is a pain in the NAS (part 1) - Traditional approaches to BLOB management
 
 
Most view of day
- Windows Server 2012 Requirements and Installation : Customizing the Interface with Features on Demand
- Windows Phone 8 : Developing for the Phone - Application Lifecycle (part 3) - Tombstoning
- Microsoft Systems Management Server 2003 : Queries (part 1) - Query Elements
- System Center Configuration Manager 2007 : Network Design - Network Discovery
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 3) - Translating Text with the Mini Translator
- Microsoft Word 2010 : Creating Desktop Publishing Documents - Adding a Watermark
- Microsoft Visio 2010 : Linking External Data to Shapes (part 2) - Preparing the Light Bulb Shape for Data Linking
- Windows Phone 8 : Configuring Basic Device Settings - Controlling the Keyboard’s Behavior (part 3) - Customizing the Keyboard’s Behavior
- Microsoft Visio 2010 : Creating and Exporting SharePoint Workflow Diagrams
- Windows Phone 7 : The Silverlight Controls (part 8) - Layout Controls - StackPanel Controls, Canvas Controls
Top 10
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
- MDT's Client Wizard : Application Properties
- MDT's Client Wizard : Operating System Properties
- MDT's Client Wizard : Customizing the Deployment Share
- Windows Server 2012 : Software and User Account Control Administration (part 5) - Maintaining application integrity - Configuring run levels
- Windows Server 2012 : Software and User Account Control Administration (part 4) - Maintaining application integrity - Application access tokens
- Windows Server 2012 : Software and User Account Control Administration (part 3) - Mastering User Account Control - Configuring UAC and Admin Approval Mode
- Windows Server 2012 : Software and User Account Control Administration (part 2) - Mastering User Account Control - Elevation, prompts, and the secure desktop
- Windows Server 2012 : Software and User Account Control Administration (part 1) - Software installation essentials
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro