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

  • Home
  • SEARCH
  • 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 985831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:13:29+00:00 2026-05-16T05:13:29+00:00

I’m attempting to write an AJAX control extender that can modify an AJAX Control

  • 0

I’m attempting to write an AJAX control extender that can modify an AJAX Control Toolkit TabPanel so that the TabPanel‘s header has an image after the text that, when clicked, hides the tab header using client-side script (without a postback). I would also like to be able to specify an onClientClose function that is also called when a tab is closed.

I’m new to ASP control extenders, and so far I’ve followed the [tutorial](http://www.asp.net/ajax/tutorials/creating-a-custom-ajax-control-toolkit-control-extender-cs“Creating a Custom AJAX Control Toolkit Control Extender”) on the ASP.NET site for creating a custom extender. I’ve called my extender a ClosableTabPanelExtender, and my extender project builds. I set up a test web page like so:

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
<asp:TabContainer ID="TabContainer1" runat="server">
    <asp:TabPanel ID="TabPanel0" runat="server">
        <HeaderTemplate>Tab 0</HeaderTemplate>
        <ContentTemplate>Hello!</ContentTemplate>
    </asp:TabPanel>
    <asp:TabPanel ID="TabPanel1" runat="server">
        <HeaderTemplate>Tab 1</HeaderTemplate>
        <ContentTemplate>Goodbye!</ContentTemplate>
    </asp:TabPanel>
</asp:TabContainer>
<cc1:ClosableTabPanelExtender ID="ClosableTabPanelExtender1" runat="server" 
    TargetControlID="TabPanel1" />

So far, I am getting the following error when I run the website:
The TargetControlID of 'ClosableTabPanelExtender1' is not valid. A control with ID 'TabPanel1' could not be found.
The error makes me think that a TabPanel can’t be extended, so am I going to have to extend the TabContainer instead?

Apart from the error, I could use some direction, especially with the Behavior script. It is the most elusive part to me, though I know that it will likely house most of the functionality that I am trying to add. I’m also not sure how the other parts of the extender work together with it.

I have the Ajax Toolkit source code, and have looked through the source for the Tab controls, which I partially understand. I’ve also looked through several examples of control extenders, primarily Matt Berseth’s extenders and one from Dan Wahlin.

  • 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-16T05:13:30+00:00Added an answer on May 16, 2026 at 5:13 am

    I finally figured out what I needed to do. For anyone who is interested in the solution:

    • In order to extend the TabPanel control, I had to get around the error I posted by overriding the OnResolveControlID method in my extender’s server code (ClosableTabPanelExtender.cs).

      protected override void OnResolveControlID(ResolveControlEventArgs e)
      {
          // Get a reference to the outermost TabContainer that contains the TabPanel being extended.
          TabContainer tabContainer = (TabContainer)base.FindControl(OuterTabPanelID);
          if (tabContainer != null)
          {
              // Check to see if any of the tabs are the control we are looking form.
              foreach (TabPanel tab in tabContainer.Tabs)
              {
                  if (tab.ID == e.ControlID)
                  {
                      e.Control = tab;
                      return;
                  }
              }
              // If none of the tabs are what we are looking for, search the contents of each tab.
              foreach (TabPanel tab in tabContainer.Tabs)
              {
                  Control ctrl = tab.FindControl(e.ControlID);
                  if (ctrl != null)
                      return;
              }
          }
      }
      
    • As for the client-side Behavior script of the extender (and the interaction between the server and client code, the articles listed on this MSDN page are helpful and will save you a lot of trouble.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.