We help IT Professionals succeed at work.

ModalPopupExtender in ContentPlaceHolder

DTwined
DTwined asked
on
Hello -

I have a ModalPopupExtender that loads perfectly when not used with a MasterPage.

Once I stick the page in a ContentPlaceHolder and load it into a MasterPage, the ModalPopupExtender does not work correctly. It shows up  in the bottom of the page. The ModalPopupExtender is being called Server-Side in case that may be a factor.

Anyone know how to fix this?

ASP.NET 3.5

thanks!
Comment
Watch Question

Author

Commented:
Thanks but I need some example code. I'm still not clear on what I need to do
Check the link of Product Site.
Here modal pop up is used in master page. This will give you a idea
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup/ModalPopup.aspx

Hope this will help you

Author

Commented:
Thanks but this is just a demonstration.
I need to see some example code
Commented:
Solution:

Add a method to your Master Page --
public class MyMaster : MasterPage
{
     public void ShowModal(string someParameter)
     {
          // Do your logic here
          // Show the modal
     }
}

Then add a method to your page, or page base like this...
public void ShowModal(string someParameter)
{
     MyMaster masterPage = this.Master as MyMaster;
     masterPage.ShowModal(someParameter);
}

http://stackoverflow.com/questions/2958422/call-show-a-modal-popup-located-in-masterpage-from-its-childs