The control with ID 'UpdatePanel1' requires a ScriptManager on the page

14,352

Solution 1

Consider ToolKitScriptManager.

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        This is Form A</div>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Button  Text="OK" runat="server"/>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>

Solution 2

Double-check to ensure it's using the master page you think it's using. Add the script manager reference to all master pages in your project and see if you still get the error.

An example where this would apply is if you're testing the site on a mobile device (or the device emulator in the Chrome debugger). If there is a mobile version of the master page in your project, it may be defaulting to that based on the device size detected. Then if that master page is missing the script manager reference, you'll get the error referenced.

Share:
14,352
S Nash
Author by

S Nash

27 years of software development. Started with a notepad, Fortran 4, and punch cards.

Updated on June 04, 2022

Comments

  • S Nash
    S Nash almost 2 years

    I'm using ASP.NET and testing a update panel. I know it does require a scriptmanager and I looked at all other similar questions in SO but no one answers my case.

    Here is my code:

    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
    
            This is Form A</div>
            <asp:ScriptManager ID="aa" runat="server"></asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    <asp:Button  Text="OK" runat="server"/>
                </ContentTemplate>
            </asp:UpdatePanel>
        </form>
    </body>
    </html>
    

    So As you see I do have a scriptmanager and still getting this error.

    Feedbacks Appreciated.

    ==============================

    None of similar questions is SO answers my question as "I Already do have a ScriptManager" in my code.