Expose ModalPopupExtender show and Hide properties in a User Control

I have a user control that contains a modalpopupextender.  How can I make the Show and Hide methods of the extender available to the page where I put the user control?
Example use in a page:
<uc1:CaseModal runat="server" id="cm1" />
Then, in my code page I want to do something like:
Public Sub....
   cm1.Show()   <---this would trigger the Show method of the Extender IN the user control.
End Sub
Here is a simple user control:
<asp:Panel id="modalPnl" runat="server" style="display:none;" CssClass="modalPopup">
   <asp:LinkButton id="closeCaseModal" runat="server" text="Close" />
            BackgroundCssClass="modalBackground" />
        <asp:LinkButton ID="fakebutton" runat="server" style="display:none;" />

Open in new window

LVL 16
Steve KrileAsked:
Who is Participating?
jmwheelerConnect With a Mentor Commented:
In the code behind file for you user control, add the following

Public Sub Show()
End Sub

Public Sub Hide()
End Sub

This should add public methods to your user control which you can use from "test.aspx"
Steve KrileAuthor Commented:
And just for clarity, if my "parent" page for the user control was "test.aspx", then I would want the cm1.show() code in "test.aspx.vb"
Steve KrileAuthor Commented:
<hand slaps forehead />  

Thanks.  That's what I wanted exactly.
All Courses

From novice to tech pro — start learning today.