Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7997971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:06:17+00:00 2026-06-04T15:06:17+00:00

I have a User Control called: Share.ascx I have a page called: News.aspx In

  • 0

I have a User Control called: Share.ascx

I have a page called: News.aspx

In News.aspx I created a ModalPopupExtender, then I addeda Panel and inside the Panel I added the User Control: Share.ascx so that when the Popup Extender is called the Panel with the User Control is displayed.

The problem:

I can only HIDE the ModalPopupExtender from News.aspx because ModalPopupExtender is defined there but I need to call the HIDE funciton of ModalPopupExtender from the User Control: Share.ascx.cs

How do I do that?

Thank you.

———————-News.aspx————————-

<asp:Content ID="Content1" runat="server">

    <asp:LinkButton ID="lbtnShare" runat="server" Text='Share Link' /> 

    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"  
    TargetControlID="lbtnShare" PopupControlID="Panel1" 
    Drag="true" RepositionMode=RepositionOnWindowResizeAndScroll
    BackgroundCssClass="modalBackground" >
    </asp:ModalPopupExtender>

    <asp:panel id="Panel1" runat="server" style="display:none">
        <uc2:ShareLink ID="ShareLink" runat="server" />
    </asp:panel>
</asp:Content>

———————-Share.ascx————————-

<asp:UpdatePanel ID="upSET" runat="server">
   <ContentTemplate>
      <asp:Button ID="btnCancel" Text="Cancel" runat="server" OnClick="btnCancel_Click" CausesValidation="false" />
   </ContentTemplate>
</asp:UpdatePanel>

The files are too long so I omitted a lot of it and only put the important parts.

Share.ascx has a Cancel button, in that button I want to call the Hide() function of ModalPopupExtender1 that is located in News.aspx.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:06:19+00:00Added an answer on June 4, 2026 at 3:06 pm

    From the usercontrol code behind try to find your ModalPopupExtender

    var popup = Parent.FindControl("ModalPopupExtender1") as ModalPopupExtender;
    

    and then call the Hide() method

    popup.Hide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control called DashboardUserControl.ascx It has a function: public void setPagination(Boolean
I have a custom user control called ErrorNotificationBox. To place that on my page
I have created a web user control called Activity. I have defined a public-facing
I have an ASP.NET Page that contains a User control called ReportCtrl (my own
I have a user control called GameButton that has a label inside it. When
I am developing a WPF application, and I have created a user control called
I have a user control called adminMenu and I use it in my index.aspx
I have an User Control that host another controls like panel, chart controls. Right
I have a user control called HomePage.xaml . I'm creating a model instance (using
I have a user control, GridMasterControl which contains (amongst other things) another control called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.