Share via


RaiseEvent Method

Applies to: SharePoint Foundation 2010

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

RaiseEvent (NamespaceURN, EventName, EventObject)

Parameters

Parameter

Description

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 1: Microsoft Visual Basic Scripting Edition

Code

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

Example 2: Microsoft JScript

Code

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

Requirements

Applies to: WPSC Object

See Also

Reference

RegisterForEvent Method

Other Resources

Web Part Page Services Component (WPSC) Object Model