AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

AdvantageModule..::..BroadcastEvent Method

Allows broadcasting of information between modules rendered in an AdvantageTemplatePage. One module can broadcast a message with an event ID and arguments, other modules that override the "ReceiveEvent" virtual method will receive the message. Messages should be broadcast PRIOR to the "PreRender Event" so that other modules may act upon the message.

Namespace:  AdvantageCMS.Core.Common.BaseClasses
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public void BroadcastEvent(
	string eventId,
	Hashtable eventArgs
)

Parameters

eventId
Type: String
Identifier of the broadcast message
eventArgs
Type: Hashtable
Data arguments

Examples


Broadcast a product selection event from a catalog module so that other modules (e.g., a details panel or a cart summary) can react:
C#
// In a ProductCatalogModule
protected void OnProductSelected(Guid productId, string productName)
{
    var args = new Hashtable
    {
        { "ProductId", productId },
        { "ProductName", productName }
    };
    BroadcastEvent("ProductSelected", args);
}