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 7625263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:10:08+00:00 2026-05-31T05:10:08+00:00

I have an UpdatePanel in my default.aspx page and the UpdatePanel has asp placeholder,

  • 0

I have an UpdatePanel in my default.aspx page and the UpdatePanel has asp placeholder, also I have an ascx control that is the navigation of the site and it is created dynamically based on the data in the database, each navigation item is an ImageButton, and my each loop in DataList has HiddenField value of the URL for each corresponded ascx control like Value=”~/controls/somecontrol.ascx”

Here is what I want/need to do:
I need to create triggers dynamically for my UpdatePanel that is in default.aspx in my ascx navigation control, so what I am exactly looking to do is that my each navigation item that is an “ImageButton” to be a trigger for this UpdatePanel and when you click on it, it will reference the placeholder in UpdatePanel and load the control based on the NavigateUrl path and do placeholder.Controls.Add(mycontrol).

Default.aspx page:

 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:PlaceHolder ID="phMainHolder" runat="server"></asp:PlaceHolder>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

Navigation ascx control:

<asp:DataList ID="dlnavigations" runat="server"  RepeatDirection="Horizontal" 
                onitemcommand="dlnavigations_ItemCommand" OnItemDataBound="dlnavigations_ItemDataBound">
                <ItemTemplate>                      
                    <asp:HiddenField ID="hfURL" Value='<%#Eval("strUrl")%>' runat="server" />     

                        <asp:ImageButton ID="imgTab" Width="20"   CommandArgument='<%#Eval("ID")%>'  
                            ImageUrl='<%#Eval("strIcon")%>' runat="server" />                        
                </ItemTemplate>
            </asp:DataList>


protected void dlnavigations_ItemCommand(object source, DataListCommandEventArgs e)
            {
                HiddenField hfURL = (HiddenField)e.Item.FindControl("hfURL");
                Control ctrl = LoadControl(hfURL.Value);
                myplaceholderinUpdatePanel.Controls.Clear();
                //here i need to reference my placeholder in UpdatePanel then
                myplaceholderinUpdatePanel.Controls.Add(ctrl);

            }

I am not very sure if this is really possible to do with UpdatePanel please any help appropriated, if i cant do it with UpdatePanel are there any other way of doing this same concept?

thank.

  • 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-05-31T05:10:09+00:00Added an answer on May 31, 2026 at 5:10 am

    If i’ve understood your requirement correctly i would suggest another approach:

    Set the UpdatePanel1's UpdateMode property to Conditional

    <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <asp:PlaceHolder ID="phMainHolder" runat="server"></asp:PlaceHolder>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    • Create a custom event in your UserControl, for example called Navigated
    • Raise this event in the LinkButton’s Command-Event
    • Handle the UserControl’s Navigated-Event in your page
    • Call the UpdatePanel1's Update method programmatically

    To clarify the event driven approach a bit, assume this is your UserControl’s codebehind:

    public partial class Navigation : System.Web.UI.UserControl
    {
       public delegate void NavigationHandler(int ID);
        public event NavigationHandler Navigated;
    
        void LinkButton_Command(Object sender, CommandEventArgs e)
        {
            int ID=int.Parse(e.CommandArgument.ToString());
            Navigated(ID);
        }
    }
    

    And your page can handle this event in the following way:

    protected void Page_Init(object sender, EventArgs e) {
        this.Navigation1.Navigated += UserNavigated;
    }
    
    protected void UserNavigated(int ID){
        //do whatever you need to do and then call...
        UpdatePanel1.Update();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a ASP.Net page (Default.aspx) which will load UserControl (ucontrol.ascx) dynamically into an UpdatePanel.
I have an UpdatePanel control in my ASP.NET application (actually several, but that's not
I have an <asp:Button ID=btnExport> control inside of an UpdatePanel. When that button is
I have Default.aspx with several controls along with Uploadify Image upload control and i
I have the following function that updates the UpdatePanel content by adding/loading an ascx
I have some links in an UpdatePanel. For example: <a href=Products.aspx>Products</a> I also have
Have an UpdatePanel that contains 2 panels with default buttons set to listen to
I have a user control that has a gridview in it with paging. The
I have a page that has two drop down lists on it and a
I have an updatepanel which after clicking one button is submitting the page. The

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.