ProfileBase::Item Property (String^)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets a profile property value indexed by the property name.

Namespace:   System.Web.Profile
Assembly:  System.Web (in System.Web.dll)

property Object^ default[
	String^ propertyName
] {
	virtual Object^ get(String^ propertyName) override;
	virtual void set(String^ propertyName, Object^ value) override;


Type: System::String^

The name of the profile property.

Property Value

Type: System::Object^

The value of the specified profile property, typed as object.

Exception Condition

An attempt was made to set a property value on an anonymous profile where the property's allowAnonymous attribute is false.


There are no properties defined for the current profile.


The specified profile property name does not exist in the current profile.


The provider for the specified profile property did not recognize the specified property.


An attempt was made to set a property value that was marked as read-only.


An attempt was made to assign a value to a property using an incompatible type.

You can use this property to retrieve or set the property values of the user profile for your application by name. Returned values are typed as object and must be cast as the specific object type when retrieved. For strongly typed access to profile property values, you can access the property by name as a member of the Profile property available on each page, for example, Profile.CustomerAddress.

The following code example lists the names of the properties in the user profile by binding the Name property from the static Properties collection of SettingsProperty objects to a GridView control. The selected property value is retrieved by name using the Item collection. For an example of a Web.config file that specifies properties for the user profile, see the example provided for the ProfileBase class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top