Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
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
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server