Link to home
Start Free TrialLog in
Avatar of Steve_Buck
Steve_BuckFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Using a dynamic Controls ID as TargetID for ModalPopupExtender

Hi,

I have a number of dynamically generated buttons added to an ajax accordion. I also have a modalPopup extender to popup a panel. I want the dynamic buttons to popup the panel. Currently I have the following: (default)

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1"
          PopupControlID="pnlJobDetails"
            CancelControlID="cmdClose"
           BackgroundCssClass="modalBackground"
/>

I want to be able todo something like:

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID=AccordionPane1.Controls(0).Controls
          PopupControlID="pnlJobDetails"
            CancelControlID="cmdClose"
           BackgroundCssClass="modalBackground"
/>

or other, if you can think of a better way of doing this please let me know. Basically I have a number of SupportJobs which are represented by the buttons on the accordion panel, added dynamically based on an SQL query. I then want to be able to pop the modal panel by pressing one of the buttons which lets you edit the details of each job, I will have to pass in the JOBID to the panel which is stored as the text property on each button.

Thanks in advance.

James.
ASKER CERTIFIED SOLUTION
Avatar of Steve_Buck
Steve_Buck
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial