Chapter 16. Using ASP.NET Data Controls

IN THIS CHAPTER

Working with data source controls

Displaying data with ASP.NET data controls

Using ASP.NET controls with SharePoint data sources

Now that you're familiar with using SharePoint Designer's Data Source Library task pane to create database connections to data sources, the next step toward creating dynamic data-driven Web pages is to place the data exposed by these data sources on the Web pages and then to format the data as per your requirements. SharePoint Designer allows Web designers to use ASP.NET 2.0 data source and data display controls to work with the data exposed by data connections. Using a simple Visual Studio-like interface, you can insert ASP.NET 2.0 data controls, bind them together to retrieve data, and then show that data on Web pages. This chapter takes you through a number of ASP.NET data controls available in SharePoint Designer. You can use these controls to display and format data on Web pages.

Like other ASP.NET controls discussed before, it's important to understand that SharePoint Designer merely provides a user interface to work with the data controls, set their properties, and bind them with each other. Each ASP.NET data control has an HTML representation that defines the control and the properties and attributes that it exposes.

Internally, SharePoint Designer writes the HTML code that facilitates the ASP.NET rendering of these controls at browse time. SharePoint Designer doesn't provide for a mechanism to write ASP.NET code-behind files. It's just that some of these ASP.NET controls are so powerful that you don't really need to write any code-behind files to use them for displaying data and changing the formatting and appearance on the Web pages.

NOTE

ASP.NET code-behind files written in .NET languages, such as C# and VB.NET, provide a mechanism to program the functionality of Web pages and the controls inserted on them.

Before you begin, here's a quick recap on the steps that are involved in working with data in ASP.NET 2.0:

  • Create an ASP.NET connection string that defines the mechanism to be used to connect to a data source. You do this in SharePoint Designer by using the Data Source Library as discussed in the previous chapter.

  • Use an ASP.NET data source control to define how the data is retrieved and what operations are performed on the data source. The SharePoint Designer Toolbox task pane exposes a number of data source controls for a variety of data sources.

  • Bind the ASP.NET data source control to a data display control to format the appearance of data that's being exposed by the data source control. ASP.NET data display controls are also available in SharePoint Designer by using the Toolbox task pane.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.206.112