ryanulit
ryanulit

Reputation: 5001

Calling one ModalPopupExtender from two different buttons?

I have a panel that is hooked up to a ModalPopupExtender but it can be called two different ways, by either adding a user (one button click) or editing a user (a totally different button click). The controls on the panel never change, but they are all blank when adding, or they are binded to the data of the particular user being edited. What should I set the TargetControlID attribute to when I have two different buttons that need to open the same panel as a modal window?

Upvotes: 0

Views: 5843

Answers (2)

Nancy
Nancy

Reputation: 11

My recommendation is to have 2 modalpopupextenders, both using the same PopupControlID for the panel you want to display in both instances.

Upvotes: 1

Jack Marchetti
Jack Marchetti

Reputation: 15754

Instead of wiring it up via the ASPX markup, you can do it in the code behind of the button event.

protected void btnClick(object sender, Eventargs e) {
   ModalName.Show();
}

Upvotes: 2

Related Questions