Chapter 1. Introducing portals and web parts
Listing 1.1. Basic Html layout for the Default.aspx page
Listing 1.2. The calendar and Label server controls appear within the WebPartZones with their titles set.
Listing 1.3. Employee count by department query
Listing 1.4. The connection string configuration for the Adventure Works database
Listing 1.5. The DataLayer class includes the logic for retrieving the connection string information from the configuration file. This is achieved with help from the ASP.NET ConfigurationManager class.
Listing 1.6. SQL.cs
Listing 1.7. The Employee class is an example of a business entity class. These classes expose a property for each field that is returned from an SQL query. Each business entity also provides a Fill method which reads the data returned from the query to its properties.
Listing 1.8. GetDataItem method uses a new feature of the .NET Framework known as Generics to allow its code to run over any type which conforms to the generic constraints that are specified.
Chapter 2. Web parts: the building blocks of portals
Listing 2.1. The ChildControl property of the GenericWebPart provides access to the underlying web control that is wrapped by the GenericWebPart.
Listing 2.2. The NumberOfDays property contains the number of days of weathers appear in the web part.
Listing 2.3. The Render method for the weather web part displays a series of random weather images.
Listing 2.4. The HTML to display the calendar user interface