October 2010
Intermediate to advanced
1920 pages
73h 55m
English
You can access the Profile object from within a component by referring to the HttpContext.Profile property. However, you must cast the value of this property to an instance of the ProfileCommon object before you access its properties.
For example, the web configuration file in Listing 28.37 defines a Profile property named firstName.
Listing 28.37. Web.Config

The component in Listing 28.38 grabs the value of the firstName Profile property. The Profile object retrieved from the current HttpContext object must be typecast to a ProfileCommon object.
Listing 28.38. App_Code\ProfileComponent.cs
To avoid ...
Read now
Unlock full access