Chapter 9. Creating a custom BDC Web Part

 

This chapter covers

  • Building a custom BDC Web Part
  • Building a basic web part
  • Using the ASP.NET Web Part methods
  • Packing and deploying the web part

In the previous chapter, we explored the ApplicationRegistry namespace and the BDC Object Model. There are several reasons why you’d want to code with the object model, as we explained in the previous chapter. One of those reasons is to create your own custom web parts. Within my company, we’ve created several web parts, including one that displays address details such as customer, supplier, or employee addresses in a Virtual Earth map. Within this web part, we take the street address and the town, using the object model to access the back-end data, then pass that information to the Virtual Earth web service. Another web part we offer displays data information in a calendar. So we created a Calendar Web Part that takes a start date, end date, and title using the back-end data, and then positions the information in the calendar control. Figure 9.1 shows a screenshot of the Lightning Tools BDC Mapper Web Part and the tool pane that displays how the properties are set. This instance of the web part is used to plot the Northwind customer addresses.

Figure 9.1. The Lightning Tools BDC Mapper Web Part, which uses business data to pinpoint addresses on a Virtual Earth map. This is done via the BDC Object Model and a custom web part.

9.1. Building a basic custom web part

9.2. Adding the functional code

9.3. Creating a code access security file

9.4. Summary