How to share the same ModalPopupExtender and the popup panel by buttons within different UpdatePanel

YesOrKnow
YesOrKnow used Ask the Experts™
on
Hi everyone,

As in my question title: I got several update panels in a page, and each of them contains a "Add Extra" button. I also added a modal popup extender, and a popup panel.

My question is how can I reuse this ModalPopupExtender for all these "Add Extra" buttons click,
it only has one TargetControlId attribute.

In addition, because I put this ModalPopupExtender outside any update panel, so I got an error when I try to open this page:
       
   "  Error:An extender can't be in a different UpdatePanel than the control it extends.  "

How can I get rid of this problem, and why an extender can't be in a different UpdatePanel than the control it extends?

Many thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dont do that.

Just on OnClick event of button, manually show ModalPopupExtender as:

ModalPopupExtender1.Show();

Hope you get what i mean.

Author

Commented:
Thanks mroonal,
I added a hidden dummy button "btnDummy" with style="display:none;" and then assigned it to the TargetControlId of ModalPopupExtender, then set all "Add Extra" button onClick to one click event handler which shows the extender.  Your solutions work well.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial