views:

166

answers:

0

Hello!

I have a bit of a problem. I'm creating a popup usercontrol controled entierly on the client side. Inside my control i have a ModalPopupExtender. The problem is that when i create two or more instances of this usercontrol the ModalPopupExtenders ID is not unique per instance, i infact get many ModalPopupExtenders with the same ID. All the other controls in my usercontrol get unique ID (_usercontrolId_controlId) but not the extender.

This causes problems when i want to select this extender in my javascript file connected to the usercontrol.

Is there a good way to get the unique Id from the extender? I can think of two solutions myself, one is to create the extender in my usercontrol code-behind, or let the page who implement the usercontrol also implement the extender.

In my asxc-file i have the extender like this:

<ajaxToolkit:ModalPopupExtender ID="SearchPopupModalPopupExtender" runat="server"
TargetControlID="SearchPopupDummyButton"
PopupControlID="SearchPopupPanel"
BackgroundCssClass="modalPopupBackground"
CancelControlID="SearchPopupCloseButton"
BehaviorID="SearchPopupModalPopupExtender"/>

I hope im clear enough here, and thanks everyone in advance.