After some reading i found out that during the postbacks except from
adding again the user controls you must also attach again the event
handlers methods of your user control back to the user control children
controls...
So ,what i ve done so far in order to solve the
problem is , every time i iterate in the arraylist that holds my
usercontrols i use
the FindControl method in order to find the
linkbutton of the usercontrol and then assing that linkbutton.click
event to the event handler of the linkbutton.
foreach (UserControl_Create_Answer uc in AnswerControlsCreated)
{
((LinkButton)uc.FindControl("lnkbtn_ChangeText")).Click += new EventHandler(Change_Text);
}
With
this technique the user controls linkbutton control works as desired
but the drawback is that i must remove the event handler "Change_Text"
form the user controls behind code and place it in every page that
hosts the user control..
I cant find a way to attach the LinkButton.Click (Child control's event) back to its event in the UserControls.ascx.cs page...