hi, I have a page that consists of 3 user controls: A, B & C. Clicking on a button in A would trigger to refresh B & C. I have two ways of implementation and both worked, was wondering which one is a better approach..
[Option 1]
On Page_Load of the page class,
this.A.ButtonClicked += new EventHandler(A_ButtonClicked);
The event handler is:protected void A_ButtonClicked(object sender, EventArgs e)
{
this.B.RefreshData();
this.C.RefreshData();
}
RefreshData is the public method defined in B & C.
[Option 2]
On Page_Load of the page class,this.A.ButtonClicked += new EventHandler(B.RefreshDataHandler);
this.A.ButtonClicked += new EventHandler(C.RefreshDataHandler);
Then in B & C user controls, the RefreshDataHandler is written as:
Go to the complete details ...