Accessing User Profile Information Using the .NET Portlet Toolkit
To access user profile information using the .NET Portlet
Toolkit, add the properties to the Web.config file and reference them
by name in the portlet page.
ASP.NET 2.0 introduced the Provider model as a design pattern
for plugging data providers into the framework. The .NET Portlet Toolkit
Portlet API uses the ProfilerProvider API to expose user profile information
sent by ALI. For more information about the ProfileProvider model,
see the
MSDN documentation.
The Web.config file
for a .NET portlet project contains a <profile> element that defines the user profile properties supported by a
Provider. In order for user profile properties from the source application
to be accessible from the ASP.NET Profile object, they must be registered
in the Web.config file.
Note: User Profile information is read-only
and can only be modified through the source application.
- Add the user profile properties to a <properties> element within the <profile> element in the
Web.config file for the portlet project. Each property must be defined
with a name and a type. If you provide a default value, it will be
used if the property is not available.
Note: The name of the property must match the name sent
by the source application.
<properties>
<add name="CustomPropertiesTitle" type="string" defaultValue="No Title"/>
<add name="MyProfileName" type="String" defaultValue="Guest"/>
<add name="MyProfileAge" type="Int32"/>
</properties>
- Reference the property in the portlet page by name using
the Profile object.
string title = Profile.CustomPropertiesTitle
string name = Profile.MyProfileName;
int age = Profile.MyProfileAge;