Click or drag to resize
BannerInfoProviderGetRandomValidBanner Method
Returns the BannerInfo structure for the random banner. Banner has to be: - enabled - valid now (ValidFrom and ValidTo) or ValidFrom and ValidTo can be null - and has more than 0 hits and clicks left (or null - unlimited)

Namespace: CMS.BannerManagement
Assembly: CMS.BannerManagement (in CMS.BannerManagement.dll) Version: 9.0.0
Syntax
C#
public static BannerInfo GetRandomValidBanner(
	int categoryId,
	bool decrementHitsLeft
)

Parameters

categoryId
Type: SystemInt32
Category ID.
decrementHitsLeft
Type: SystemBoolean
If true, hits left (after reaching 0, this banner won't be returned) of the returned banner will be decremented

Return Value

Type: BannerInfo
See Also