Datasheet
</tr>
</table>
</form>
</body>
</html>
To start with, you declare a WebPartManager control. The WebPartManager control is a must for any
ASP.NET page that utilizes Web Parts. This control must be the first element in an ASP.NET web form,
above all other Web Parts, zones, or any other custom or specialized Web Part controls. The
WebPartManager has no visual element associated with it; however, it is crucial because of the required
plumbing it provides for managing the interactions between Web Parts. Then the code declares a
WebPartZone control, which in turn includes a Label control that consists of all the HTML elements
that make up the display of the Web Part. The
WebPartZone control is the one that provides overall lay-
out for the Web Part controls that compose the main UI of a page. Before navigating to the page using
the browser, enable Windows Authentication for the web site through IIS Manager and ensure that SQL
Server 2005 Express is installed with Windows authentication enabled. Now run the page, and you will
see the output shown in Figure 1-2.
Figure 1-2
In Figure 1-2, you can choose to minimize or close the Web Part by clicking on the corresponding links.
Personalization Framework
There are times when you want to store and present information that is unique to a specific user. For
instance, when a user visits your site, you can collect information from the user about his preferences,
such as color scheme, styles, and so forth. Once you have that information, you can use it to present the
user with a personalized version of your web application. To implement this with ASP.NET 1.x, you had
to go through the following steps.
1. Store user information with a unique user identifier, used to identify the user when he visits
again.
2. Fetch the user information as needed.
3. Finally, present the user with the personalized content.
15
Chapter 1: Introduction to ASP.NET 2.0
05_041796 ch01.qxp 12/29/06 9:09 PM Page 15