Share via


TargetingContextProfile Property

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Gets or sets the TargetingContext profile for use on the page. The TargetingContext profile is used to pass runtime properties into the ContentSelector or ExpressionEvaluator for targeting.

Namespace:  Microsoft.CommerceServer.Runtime.Targeting
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Property TargetingContextProfile As Profile
'Usage
Dim instance As TargetingSystemInfo
Dim value As Profile

value = instance.TargetingContextProfile

instance.TargetingContextProfile = value
public Profile TargetingContextProfile { get; set; }
public:
property Profile^ TargetingContextProfile {
    Profile^ get ();
    void set (Profile^ value);
}
public function get TargetingContextProfile () : Profile
public function set TargetingContextProfile (value : Profile)

Property Value

Type: Microsoft.CommerceServer.Runtime.Profiles..::.Profile
The TargetingContext profile for use on the page

Remarks

If the property is accessed before it is explicitly set, a new instance will automatically be created and returned.

Examples

ctx = CommerceContext.Current;
ContentSelector cso = ctx.TargetingSystem.SelectionContexts["advertising"].GetSelector();
ctx.TargetingSystem.TargetingContext["PageGroup"].Value = "premium";
ctx.TargetingSystem.Profiles.Add("TargetingContext", ctx.TargetingSystem.TargetingContextProfile);
ctx.TargetingSystem.Profiles.Add("User", ctx.UserProfile);
StringCollection content = cso.GetContent();

Permissions

See Also

Reference

TargetingSystemInfo Class

TargetingSystemInfo Members

Microsoft.CommerceServer.Runtime.Targeting Namespace