I have been write code in Page_Load function like this
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
UserControl1.Button_Clicked += new EventHandler(UserControl1_Button_Clicked);
}
}
But the same function will be added again when the page is directing to this page from the other page.
Is there any kind of method to prevent it happened?
I'm trying to use session to prevent it, but I would like to know is there any better method can do the same work. Thanks a lot!