Strange Error - "Not A Registered Extender Control"

Last post 02-03-2009 11:46 AM by djmozy. 15 replies.

Sort Posts:

  • Surprise [:O] Strange Error - "Not A Registered Extender Control"

    02-22-2007, 7:23 PM
    • Member
      2 point Member
    • Tickr
    • Member since 02-22-2007, 9:16 PM
    • Posts 5

    I am trying to use the calendar extender control, and am getting a strange error:

    Extender control 'CalendarExtender1' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors().
    Parameter name: extenderControl
     

    I'll put the stack trace at the bottom.  My goal this evening was to add this control to an existing web page.  I added a script manager and a Calendar Extender control, like this:

        <asp:ScriptManager id="ScriptManager1" runat="server">
        </asp:ScriptManager>

        Event Date:
        <asp:TextBox ID="EventDate" runat="server"></asp:TextBox>
        <asp:Image ID="cal_EventDate" runat="server" ImageUrl="~/Images/minical.gif" />&nbsp;

        <ajaxToolkit:CalendarExtender PopupButtonID="cal_EventDate" TargetControlID="EventDate" ID="CalendarExtender1" runat="server">
        </ajaxToolkit:CalendarExtender> 

    I get the error above.  Just for testing, I created a blank page in my website with that code, and everything works fine.  The page I get the error on is in another directory with it's own web.config file, so on a hunch I tried copying the appropriate web.config sections from the root of my app to that web.config, but that didn't help either.  Does anybody have any idea what might be causing this?

     Thanks,

    Rick

    Partial stack trace:

    [ArgumentException: Extender control 'CalendarExtender1' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors().
    Parameter name: extenderControl]
    System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IExtenderControl extenderControl) +474
    System.Web.UI.ScriptManager.RegisterScriptDescriptors(IExtenderControl extenderControl) +41
    System.Web.UI.ExtenderControl.Render(HtmlTextWriter writer) +62
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +74
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +291
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49
    System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +234
    System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +53
    System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +43
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +74
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +291
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49


     

     

     

  • Re: Strange Error - "Not A Registered Extender Control"

    03-02-2007, 3:53 PM
    • Member
      2 point Member
    • Tickr
    • Member since 02-22-2007, 9:16 PM
    • Posts 5
    Does anybody have any advice on this one?
  • Re: Strange Error - "Not A Registered Extender Control"

    03-02-2007, 9:29 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-11-2006, 1:39 AM
    • Microsoft
    • Posts 1,842
    • AspNetTeam
    As you say above, because this works fine on a new page, it seems likely that something about the configuration of the page it doesn't work on is responsible for the problem.

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Strange Error - "Not A Registered Extender Control"

    03-07-2007, 8:32 PM
    • Member
      546 point Member
    • prowla2003
    • Member since 06-10-2003, 9:10 AM
    • Sydney
    • Posts 138

     

    i get the same error....

     

    Extender control 'hme3' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors().
    Parameter name: extenderControl

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Extender control 'hme3' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors().
    Parameter name: extenderControl

    Source Error:

    Line 44:         HtmlTextWriter htw = new HtmlTextWriter(sw);
    Line 45: 
    Line 46:         GridView1.RenderControl(htw);
    Line 47: 
    Line 48:         Response.Write(sw.ToString());

     

     

    I'm following the code in this article  http://gridviewguy.com/ArticleDetails.aspx?articleID=197  to export a gridview to excel and it worked fine until I added a AJAXControlToolKit Hover Menu Control into the grid...

     

    any ideas??

    Paul.

    If you want Reflexology in Sydney then click on the link...

  • Re: Strange Error - "Not A Registered Extender Control"

    04-13-2007, 2:53 PM
    • Member
      400 point Member
    • ersheido
    • Member since 02-25-2003, 8:51 AM
    • Posts 102
    Did anyone find a solution to this problem?
  • Re: Strange Error - "Not A Registered Extender Control"

    04-19-2007, 1:06 AM
    • Member
      546 point Member
    • prowla2003
    • Member since 06-10-2003, 9:10 AM
    • Sydney
    • Posts 138

    my problem was specific to exporting a gridview to excel where the first column of the gridview had an AJAX HoverMenu Control in it.

     the fix was not to export that column 

     

    ie in the export to xls code have this

            //Hide AJAX hovermenu columm
            GridView1.Columns[0].Visible = false;
            //Bind updated GridView
            GridView1.DataBind()

    Paul.

    If you want Reflexology in Sydney then click on the link...

  • Re: Strange Error - "Not A Registered Extender Control"

    06-29-2007, 3:34 AM
    • Member
      2 point Member
    • Bindu_01
    • Member since 04-26-2007, 5:52 AM
    • Posts 5

    I am getting the same error for CalendarExtender Control as below

    "Extender control 'CalendarExtender1 is not a registered extender control.
    Extender controls must be registered using RegisterExtenderControl() before calling
    RegisterScriptDescriptors().
    Parameter name: extenderControl "

    In the same page I have got another CalendarExtender Control but it is working well. 

    If you have the answer please post it in the forum

     

     

     

  • Re: Strange Error - "Not A Registered Extender Control"

    07-04-2007, 11:07 AM

    I also wanted to follow up with this as I have been experiencing a similar problem.  I receive the same error when trying to add Views to a MultiView dynamically (at run time).  Each dynamically created view contains a HoverMenuExtender and this is the source of my problem.  I have no problem creating the controls and adding Views to the MultiView dynamically the problem occurs when I try to remove a page from the MultiView.  It is at this point that I get the "Extender control '_FormatHoverMenuExtender' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors()."

     Similar problem, just a different way to get there.  Hopefully this will insight more discussion.
     

  • Re: Strange Error - "Not A Registered Extender Control"

    08-15-2007, 10:02 PM
    • Member
      27 point Member
    • aboreham
    • Member since 02-26-2007, 4:22 AM
    • Posts 70
  • Re: Strange Error - "Not A Registered Extender Control"

    12-29-2007, 3:29 AM
    • Member
      18 point Member
    • poiu
    • Member since 12-06-2007, 8:45 PM
    • Posts 9

    Try removing the extender.  Then add a ScriptReference to your ScriptManager (I didn't try this, but it would look like this: <asp:ScriptReference Assembly="AjaxControlToolkit" Name="AjaxControlToolkit.AlwaysVisibleControlBehavior.js") and then add a touch of javascript to hook it up like what I did below.

    I ran into this error and I did a lot of research to try to find out what the problem was and how to fix it.  The only thing that I came up with is that under any circumstance where the PreRender method isn't called on the extender control, this error would come up. The RegisterExtenderControl method MUST be called during the PreRender method, and the RegisterScriptDescriptors method is getting executed during the Render method.  This is a problem because the PreRender method on the control isn't being called.

    I also wanted to modify the functionality of the Always Visible Control extender so that the control would always have the same horizontal position, and never have less than the it's original vertical position.  So I extracted the javascript code that I needed, removed the rest, and changed what I wanted.  Regardless, this took care of both problems at once (got rid of the error, and let me alter the behavior).

    In my user control, I have a ScriptManagerProxy followed by a small javascript codeblock like so: 

    <asp:ScriptManagerProxy ID="proxy" runat="server">
        <Scripts>
            <asp:ScriptReference Path="KeepTop.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
    
    <script type="text/javascript">
    
    Sys.Application.add_load(function(sender, args) {
        $create(Position.KeepTop, null, null, null, $get('<%= Me.FloatPanel.ClientId %>'));
    });
    
    </script
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="FloatPanel" runat="server" Width="300px">
    ...
    ...
     

     

    Here's the source code for that KeepTop.js file.

    /// <reference name="MicrosoftAjax.js" />
    
    Type.registerNamespace('Position');
    
    Position.KeepTop = function(element) {
        /// <param name="element" type="Sys.UI.DomElement" domElement="true">
        /// The DOM element that is associated with
        /// </param>
        
        Position.KeepTop.initializeBase(this, [element]);
        
        this._handler = null;
        this._verticalOffset = Sys.UI.DomElement.getBounds(element).y;
    }
    
    Position.KeepTop.prototype = {
        initialize : function() 
        {
            Position.KeepTop.callBaseMethod(this, 'initialize');
            
            var element = this.get_element();
            if (!element) throw Error.invalidOperation("element required");
            
            this._handler = Function.createDelegate(this, this._reposition);
            
            // Attach the onScroll event handler
            Sys.UI.DomEvent.addHandler(window, 'scroll', this._handler);
            
            this._reposition();
        },
        
        dispose : function()
        {
            if (this._handler) {
                Sys.UI.DomEvent.removeHandler(window, 'scroll', this._handler);
            }
            Position.KeepTop.callBaseMethod(this, 'dispose');
        },
        
        _reposition : function(eventObject)
        {
            /// <param name="eventObject" type="Sys.UI.DomEvent">
            /// Event info
            /// </param>
            /// <returns />
            
            var element = this.get_element();
            if (!element) return;
            
            var location = Sys.UI.DomElement.getLocation(element);
            var scrollTop = 0;
            
            if (document.documentElement && document.documentElement.scrollTop)
                scrollTop = document.documentElement.scrollTop;
            else
                scrollTop = document.body.scrollTop;
            
            location.y = scrollTop + this.get_verticalOffset();
            
            Sys.UI.DomElement.setLocation(element, location.x, location.y);
        },
        
        get_verticalOffset : function() {
            /// <value type="Number" integer="true">
            /// Distance to the vertical edge of the browser in pixels from the same side of the target control. The default is the original vertical position of the element in pixels.
            /// </value>
            return this._verticalOffset;
        },
        set_verticalOffset : function(value) {
            if (this._verticalOffset != value) {
                this._verticalOffset = value;
                this._reposition();
                this.raisePropertyChanged('verticalOffset');
            }
        }
    }
    
    Position.KeepTop.registerClass('Position.KeepTop', Sys.UI.Control);
    
    if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

     

    Sadly, that's as close to an answer that I've discovered so far.  If I find a better way, I'll post it.

  • Re: Strange Error - "Not A Registered Extender Control"

    12-29-2007, 4:20 PM
    • Member
      18 point Member
    • poiu
    • Member since 12-06-2007, 8:45 PM
    • Posts 9

    I needed to do the same thing in a wizard control with dynamically created steps hosting dynamically created controls that used the MaskedEditExtender and found that I just couldn't use the technique I provided above for that.  So, lots more research into the issue and guess what.  I found a very simple solution.

    Again, the extender control MUST be registered with the ScriptManager's RegisterExtenderControl during it's PreRender, which won't get called at all from within the wizard control because the WizardStep controls Visible property will return False hence your control will never do the PreRender stuff - at least when dynamically creating everything.

    So, here's the solution I came up with.

    1) Create your user control as you would expect you should be able to.

    2) Create a class that inherits from WizardStepBase, with one boolean property (I called it ForceVisible), and override the Visible property

    4) in the Visible override, return True if your ForceVisible property is True, else return MyBase.Visible

    3) In the page's Init event, create all your controls - use your new wizard step class

    5) In the page's OnPreRender event, set the ForceVisible property to True for each of your wizard steps, then call the MyBase.OnPreRender(3)

    6) In the page's Overrides Sub Render, set the ForceVisible property to False for eacy of your wizard steps, then call the MyBase.Render(writer)

    7) Enjoy! - This was such a pain in the butt, I really hope this helps save everyone a bunch of time.

    The Wiz class code:

     

    Public Class Wiz
        Inherits WizardStepBase
    
        Private _force As Boolean
    
        Public Property ForceVisible() As Boolean
            Get
                Return _force
            End Get
            Set(ByVal value As Boolean)
                _force = value
            End Set
        End Property
    
        Public Overrides Property Visible() As Boolean
            Get
                If Me.ForceVisible Then
                    Return True
                Else
                    Return MyBase.Visible
                End If
            End Get
            Set(ByVal value As Boolean)
                MyBase.Visible = value
            End Set
        End Property
    End Class

     

    In the page that you host your wizard control:

    Partial Class WizardPage
        Inherits System.Web.UI.Page
    
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    
            ' add wizard steps here
            Wizard1.WizardSteps.Clear()
            
            For ix As Integer = 0 to 5        
                Dim ctrl As UserControls_TeamRegistration = LoadControl("~/UserControls/TeamRegistration.ascx")
    
                ctrl.ID = "Reg" & ix.ToString
    
                Dim newStep As Wiz = LoadControl(GetType(Wiz), Nothing)
                newStep.ID = "Step" & ix.ToString()
                newStep.Title = "Step" & ix.ToString()
                newStep.Controls.Add(ctrl)
                Wizard1.WizardSteps.Add(newStep)
            Next
        End Sub
    
        Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
            For Each s As Wiz In Wizard1.WizardSteps
                s.ForceVisible = True
            Next
            MyBase.OnPreRender(e)
        End Sub
        
        Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
            For Each s As Wiz In Wizard1.WizardSteps
                s.ForceVisible = False
            Next
            MyBase.Render(writer)
        End Sub
    End Class
     
  • Re: Strange Error - "Not A Registered Extender Control"

    12-31-2007, 2:01 AM
    • Member
      18 point Member
    • poiu
    • Member since 12-06-2007, 8:45 PM
    • Posts 9

    I just discovered a problem with my last post.  Setting the ForceVisible = False in the Render has some negative side effects on the ViewState.  So I moved the For Each statement from the Render override to the OnPreRenderComplete override like this:

        Protected Overrides Sub OnPreRenderComplete(ByVal e As System.EventArgs)
            For Each s As Wiz In Wizard1.WizardSteps
                s.ForceVisable = False
            Next
    
            MyBase.OnPreRenderComplete(e)
        End Sub
     
  • Re: Strange Error - "Not A Registered Extender Control"

    01-11-2008, 11:07 AM
    • Member
      2 point Member
    • bcaff86
    • Member since 01-11-2008, 4:04 PM
    • Posts 1

     I am also getting this error.  I am trying to put the DropDownExtender in a templated column of an Infragistics UltraWebGrid.  It loads fine but certain actions in the grid require me to re-data bind.  It's on this second data binding trip that I get the error:

     

    Extender control 'dde_75011' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors().
    Parameter name: extenderControl

    Any ideas on how I can get around this? 

     

  • Re: Strange Error - "Not A Registered Extender Control"

    01-15-2008, 1:15 PM
    • Member
      18 point Member
    • poiu
    • Member since 12-06-2007, 8:45 PM
    • Posts 9

    No control will try to pre-render its child controls if its Visible Get returns False, so you'll need to find the offending parent control and find a way to make it's Visible property return True like in my example with a Wizard control above.  Once you do that, this error will go away.  You may find other side effects by doing that, but it's the only way.  Also, when you do find the control and figure out how to force its Visible to return true you'll need to do it in the OnPreRender.  Good luck

  • Re: Strange Error - "Not A Registered Extender Control"

    08-31-2008, 5:24 AM
    • Member
      5 point Member
    • sqy
    • Member since 08-31-2008, 9:16 AM
    • Posts 4

     I get the same Error, when using an AJAX "PopupControlExtender" inside the "DayRender" Event of a Calendar, does anybody know how to fix this problem? thx.

Page 1 of 2 (16 items) 1 2 Next >