Partager via


RaiseEvent Method

Notifies Web Parts within a Web Part Page that an event has occurred.

RaiseEvent (NamespaceURN, EventName, EventObject)

NamespaceURN  A string indicating a user-defined namespace that defines a context for resolving event names, object names, and so on.

EventName  A string indicating the name of the event for which Web Parts can register.

EventObject  Optional. A Variant that contains additional data passed to the function registered for this event. Usually this is a reference to the object that triggered the event, for example, the button that fired the onClick event.

Remarks

The RaiseEvent method works together with the RegisterForEvent method to create a coordinated response among Web Parts.

The NamespaceURN parameter defines the context for the event. For example, you can have multiple onChange events in a single Web Part or Web Part Page. By defining a NamespaceURN, you provide a way to distinguish between onChange events that occur on a Customer object, an Employee object, or some other object.

Examples of valid values include URLs, an object name, or some descriptive name. Valid examples include customer, myCompany.com:customer, and myCompany.com:myApp:customer.

Example

Microsoft Visual Basic Scripting Edition:

WPSC.RaiseEvent "urn:testchanges", "myEvent", "param"

Microsoft JScript:

WPSC.RaiseEvent("urn:testchanges", "myEvent", "param");

Requirements

Platforms: Microsoft Windows Server 2003

RegisterForEvent Method Applies to: WPSC Object