// Override OnWebRender() to register the additional custom events:
protected override voide OnWebRender(dynamic config) {
base.OnWebRender((object)config);
// add the new events to the list of wired events.
config.wiredEvents.Add("labelClicked");
// if the event "labelClicked" carried data with it, we need to declare the name of the data member like this:
config.wiredEvents.Add("labelClicked(Name)");
// the name in parethesis cna be anything. the example above used Name since the event was simply firing back the name.
// the example below uses "Data" as a more appropriate name when the event carries complex data structures:
config.wiredEvents.Add("labelClicked(Data)");
// To handle the event, override OnWebEvent():
protected override void OnWebEvent(WisejEventArgs e) {
// the data caming in from the client is accessible using e.Parameters.{Name}.
// in the case of the event sending back simply the name: this.fireDataEvent("labelClick", label.getName());
AlertBox.Show(e.Parameters.Name);
// in the case of the event sending back a data strucure:
AlertBox.Show("Label Clicked at X:" + e.Parameters.Data.x + " Y: " + e.Parameters.Data.y);