Link to home
Start Free TrialLog in
Avatar of Steve Krile
Steve KrileFlag for United States of America

asked on

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" />
</asp:Panel>
 
        <cc1:ModalPopupExtender 
            ID="CaseModalExtender" 
            runat="server" 
            TargetControlID="fakeButton" 
            PopupControlID="modalPnl"
            OkControlID="closeCaseModal"
            BackgroundCssClass="modalBackground" />
        <asp:LinkButton ID="fakebutton" runat="server" style="display:none;" />

Open in new window

Avatar of Steve Krile
Steve Krile
Flag of United States of America image

ASKER

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"
ASKER CERTIFIED SOLUTION
Avatar of jmwheeler
jmwheeler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<hand slaps forehead />  

Thanks.  That's what I wanted exactly.