Handles subscription for a user other than the currently logged in. Use Subscription for the currently
logged on user.
Namespace:
EPiServer.PersonalizationAssembly: EPiServer (in EPiServer.dll) Version: 5.2.375.236
Syntax
| C# |
|---|
[SerializableAttribute] public class SubscriptionInfo |
Examples
Adds a subscription for a user with login "John".
CopyC#
IList<EPiServerProfile> list = EPiServerProfile.GetProfiles("John"); if(list.Count != 1) throw new EPiServerException("Can't set subscriptions for groups or non existing members!"); EPiServerProfile profile = EPiServerProfile.GetProfiles("John")[0]; EPiServer.Core.PageReference currentPage = EPiServer.DataFactory.Instance.CurrentPage.PageLink; if (profile.SubscriptionInfo.IsSubscribingTo(currentPage)) Response.Write("User is already subscribing"); else { profile.SubscriptionInfo.SubscribeTo(currentPage); Response.Write("Subscription added"); }