kjv
kjv

Reputation: 11327

Populate user control on event raised by another user control in the same page

In a webpart I have two user controls loaded. I want to be able to populate one of the controls when an event is triggered in the other control, a parameter has to be passed between the controls.

Upvotes: 0

Views: 415

Answers (1)

JoshBerke
JoshBerke

Reputation: 67108

You could have your webpart wire the two controls together so lets assume your controls are producer and consumer.

void on_Load()
{
   producer.CustomEvent+=new EventHandler(consumer.HandleCustomEvent);
}

This is one of the simpler solutions however it can be brittle.

Upvotes: 2

Related Questions