locked
Why it errors out: The ScriptManager must appear before any controls that need it. RRS feed

  • Question

  • User-10248131 posted

    Hello,

    I have a menu user control and am using hme

    <ajaxToolkit:HoverMenuExtender ID="hme" runat="Server"
        TargetControlID="HyperLink23"
        PopupControlID="SubMenuForLatam"
        HoverCssClass="popupHover"
        PopupPosition="Bottom"
        OffsetX="3"
        OffsetY="3"
        PopDelay="50" />
    <asp:Panel CssClass="popupMenu" ID="SubMenuForLatam"
            runat="server">
                    <asp:HyperLink ID="HyperLink6" runat="server" Target="_blank" NavigateUrl="List.aspx?q=ds">Chili</asp:HyperLink> &nbsp; &nbsp; &nbsp;
                    <asp:HyperLink ID="HyperLink7" runat="server" Target="_blank" NavigateUrl="List.aspx?q=ds">Columnbia</asp:HyperLink> &nbsp; &nbsp; &nbsp;
                    <asp:HyperLink ID="HyperLink8" runat="server" Target="_blank" NavigateUrl="List.aspx?q=ds">Costa Rica</asp:HyperLink> &nbsp; &nbsp; &nbsp;
                    <asp:HyperLink ID="HyperLink27" runat="server" Target="_blank" NavigateUrl="List.aspx?q=ds">El Salvado</asp:HyperLink> &nbsp; &nbsp; &nbsp;
                    <asp:HyperLink ID="HyperLink28" runat="server" Target="_blank" NavigateUrl="List.aspx?q=ds">Panama</asp:HyperLink> &nbsp; &nbsp; &nbsp;
                    <asp:HyperLink ID="HyperLink29" runat="server" Target="_blank" NavigateUrl="List.aspx?q=ds">Peru</asp:HyperLink> &nbsp; &nbsp; &nbsp;
        </asp:Panel>


    I do have

    <ajaxToolkit:ToolkitScriptManager  ID="ScriptManager1" runat="server">
    </ajaxToolkit:ToolkitScriptManager >

    at the very begining of the user control.

    I have all my pages in the project using this menu user control.

    I don't have any issue on my localhost but after I promoted the project to server, it always throws me the following error:

    The control with ID 'hme' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

    Why am I seeing this difference? how do I fix this issue? Thank you very much.

    I am using Ajax Control Toolkit 3, 5, 50508, 0

    Wednesday, November 13, 2013 2:01 PM

Answers

  • User555306248 posted

    If you do want to include the script manager in the MasterPage, be sure to use a script manager proxy instead. If it's on an individual page that is based on a MasterPage then you may use a normal ScriptManager.

    http://forums.asp.net/p/1249361/2304962.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 13, 2013 10:58 PM

All replies

  • User1992938117 posted

    Could you try to use ScriptManager in Master Page (If you have) or parent page of user control.

    <ajaxToolkit:ToolkitScriptManager  ID="ScriptManager1" runat="server">
    </ajaxToolkit:ToolkitScriptManager >



    Wednesday, November 13, 2013 2:09 PM
  • User-10248131 posted

    Thanks for reply, although yes I can try it, but it doesn't make sense to me as it is working as expected on my local

    Wednesday, November 13, 2013 2:12 PM
  • User-10248131 posted

    After I changed it to ScriptManager instead of ToolkitScriptManager, it now throws "unknown server tag 'ajaxToolkit:ScriptManager'"

    Wednesday, November 13, 2013 2:24 PM
  • User-10248131 posted

    I do have AjaxControlToolkit.dll in my \bin and it is referenced in the property of the project

    My webconfig has this:

    			<assemblies>
    				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data.Services.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data.Services.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			</assemblies>



    Wednesday, November 13, 2013 2:27 PM
  • User555306248 posted

    If you do want to include the script manager in the MasterPage, be sure to use a script manager proxy instead. If it's on an individual page that is based on a MasterPage then you may use a normal ScriptManager.

    http://forums.asp.net/p/1249361/2304962.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 13, 2013 10:58 PM