Datasheet
The final component of the personalization framework is the profile service. A profile is all the data
associated with a specific identity. The profile service allows you to store and retrieve data for a particu-
lar identity or role. To access the profile service, you need a profile provider that handles all the data
access for you. The profile service is very flexible: you can store any data from simple datatypes (for
example, strings) right up to an object (provided that the object can be serialized). In addition, saving
and restoring data from the profile is handled for you automatically.
Summary
In this chapter you’ve learned about the two types of controls that you can use in ASP.NET:
❑ User controls: A combination of content, static HTML, ASP.NET tags, and code, built using the
same tools that you use to create Web pages.
❑ Custom controls/WebParts: A code-only solution, very similar to ASP.NET custom controls.
Unlike custom controls, you cannot inherit from other controls when building a Web Part.
These controls are the focus of this book.
By the end of this book you’ll have learned how to build the more powerful and flexible custom con-
trols. I also show you how to use these controls as Web Parts and how to extend custom controls to let
users customize your site. Along the way, you’ll also see how easy it is to build user controls — and both
how to add custom control features to user controls and use them as Web Parts.
While it’s good to know about controls, what’s important to you is what you do with those controls.
You’ve seen how these ASP.NET tools support two different scenarios:
❑ Reusability: Controls support reusability in the user interface (or presentation) layer rather than in
the business rules layer. Like other reusability tools, controls enable you to provide a standardized
set of services and improve your own productivity.
❑ Customization: Web Parts allow you to support customization to a degree that simply wasn’t
possible in earlier versions of ASP and ASP.NET. With Web Parts, you can allow your users to
create customized versions of existing pages, or to create pages that were not intended to be
included in the application. While this empowers your users, it also opens up a whole new set
of challenges for the developer, both in determining what Web Parts the user community will
need and ensuring that those Web Parts will work in all the different ways that users want.
Finally, in order to support customization, you also need personalization: the ability to keep track of a
user’s choices, remember those changes from one session to another, and connect the user to his cus-
tomized pages. Personalization is the extension of identity-based security into application development.
Over the rest of this book, you’ll see how to build custom controls, user controls, and Web Parts.
The personalization framework allows you to store, as part of a profile, the Web Part
customizations associated with some identity. The membership provider allows you
to keep track of which identities are being used. The login controls assign identities
to users.
21
Creating Your Own Controls
05_57860x ch01.qxd 10/4/05 9:26 PM Page 21