Try our conversational search powered by Generative AI!

Class SubscriptionDataSource

Provides Subscription data to DataBoundControl implementations.

Inheritance
System.Object
GenericDataSource<UserSubscriptionInfo, System.Collections.Generic.List<UserSubscriptionInfo>, System.Int32>
SubscriptionDataSource
Implements
Inherited Members
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
[Obsolete("The subscription feature is being phased out, it will continue to work but we do recommend not using it for new solutions")]
public class SubscriptionDataSource : GenericDataSource<UserSubscriptionInfo, List<UserSubscriptionInfo>, int>, IDataSourceMethods

Constructors

SubscriptionDataSource()

Initializes a new instance of the SubscriptionDataSource class.

Declaration
public SubscriptionDataSource()

Properties

CanDelete

Indicates whether a SubscriptionDataSource supports instance deletions which it does not.

Declaration
protected override bool CanDelete { get; }
Property Value
Type Description
System.Boolean

false

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.CanDelete

CanInsert

Indicates whether a SubscriptionDataSource supports instance inserts which it does not.

Declaration
protected override bool CanInsert { get; }
Property Value
Type Description
System.Boolean

false

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.CanInsert

CanUpdate

Indicates whether a SubscriptionDataSource supports instance updates which it does not.

Declaration
protected override bool CanUpdate { get; }
Property Value
Type Description
System.Boolean

false

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.CanUpdate

Language

Gets or sets the language for which subscriptions should be listed

Declaration
public string Language { get; set; }
Property Value
Type Description
System.String

Gets or sets a reference to the root page for subscription. This property is required for non EPiServer pages. If no page link is specified the data source control attempts to load the root subsciption information from the current EPiServer page.

Declaration
public PageReference PageLink { get; set; }
Property Value
Type Description
PageReference

SubscriptionService

Gets or sets the subscription service.

Declaration
public Injected<SubscriptionService> SubscriptionService { get; set; }
Property Value
Type Description
Injected<SubscriptionService>

The subscription service.

Methods

CreateItem(List<UserSubscriptionInfo>)

SubscriptionDataSource does not support creation of items

Declaration
protected override UserSubscriptionInfo CreateItem(List<UserSubscriptionInfo> items)
Parameters
Type Name Description
System.Collections.Generic.List<UserSubscriptionInfo> items

the list of current instances in the given scope.

Returns
Type Description
UserSubscriptionInfo

NotSupportedException

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.CreateItem(System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>)

DeleteItem(UserSubscriptionInfo)

Not supported by SubscriptionDataSource. Will throw NotSupportedException

Declaration
protected override void DeleteItem(UserSubscriptionInfo item)
Parameters
Type Name Description
UserSubscriptionInfo item

The item to delete.

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.DeleteItem(EPiServer.Web.WebControls.UserSubscriptionInfo)

ListItems()

Lists all subscription pages

Declaration
protected override List<UserSubscriptionInfo> ListItems()
Returns
Type Description
System.Collections.Generic.List<UserSubscriptionInfo>

a list of instances.

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.ListItems()

LoadItem(Int32)

Not supported by SubscriptionDataSource. Will throw NotSupportedException

Declaration
protected override UserSubscriptionInfo LoadItem(int key)
Parameters
Type Name Description
System.Int32 key

The item to load.

Returns
Type Description
UserSubscriptionInfo

NotSupportedException

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.LoadItem(System.Int32)

SaveItem(UserSubscriptionInfo)

Not supported by SubscriptionDataSource. Will throw NotSupportedException

Declaration
protected override void SaveItem(UserSubscriptionInfo item)
Parameters
Type Name Description
UserSubscriptionInfo item

The item to persist.

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.Web.WebControls.UserSubscriptionInfo, System.Collections.Generic.List<EPiServer.Web.WebControls.UserSubscriptionInfo>, System.Int32>.SaveItem(EPiServer.Web.WebControls.UserSubscriptionInfo)

Implements

Extension Methods