1
Answer

UpdatePanel Trigger registration for dynamic controls is IMPOSSIBLE!

Enrico Piccini

Enrico Piccini

14y
6.3k
1
Hi to all,
i have a big problem with a dynamic Imagebutton... 
My scenario is the follow: i have a "master page" with scriptmanager and usercontrol containing a button.
When i click button,it open ModalPopUpExtender(also contained into the same usercontrol) that contains UpdatePanel child and also, into the update panel, there is a table that contains dynamic labels and ImageButtons!

The update Panel is setted to Conditional, so when i click an ImageButton, it don't lose any table rows, BUT this dynamic controls NOT REGISTERED to scriptmanager how "AsyncPostBackTrigger" so they didn't any postback!!!

I tryed to register it after the form INIT, but i fail:

1) my scriptManager is in the parent page and i don't to reach it to call "registerasyncpostbackcontrol"... how can i reach my parent control from my ascx?

2) if i understand all, i don't register Trigger to my Update Panel AFTER THE FORM INIT....is it true?? (i read that i do it calling "registerasyncpostbackcontrol", is it true??)

I write this code after the declaration of my dynamic ImageButton:
AsyncPostBackTrigger ImgAddTrigger = new AsyncPostBackTrigger();
ImgAddTrigger.ControlID = ImgAdd.ID + cont.ToString();
ImgAddTrigger.EventName = "Click";
UpdatePanelTabellaPartner.Triggers.Add(ImgAddTrigger);
UpdatePanelTabellaPartner.Update();

but it didn't work..so i think that i must call "registerasyncpostbackcontrol"

I'm Sorry for my english that is not good...
Thanks in advance for the answers!

If anybody solve this problem, i think that is the best!! I'm going crazy trying to solve this problem!!

Answers (1)