views:

233

answers:

1

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?

A: 

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();
}
Jack Marchetti
Doesn't the targetcontrolid need to be set to something? I get an error when it isn't.
ryanulit
Yea that works. I just set the targetcontrolid to a button I don't use and show programmatically.
ryanulit
when doing this, I usualyl set the TargetControlID to some dummy hidden field.
Jack Marchetti

related questions