3

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.

S Nash
  • 2,363
  • 3
  • 34
  • 64
  • possible duplicate of [The ScriptManager must appear before any controls that need it](http://stackoverflow.com/questions/13473808/the-scriptmanager-must-appear-before-any-controls-that-need-it) – VMAtm Apr 10 '15 at 12:33
  • No it is not a duplicate at all. If you read my question carefully I explained that I already have a "Scriptmanager". If you think this is duplicate give me one link in SO which has this question and code contains Scriptmanager. – S Nash Apr 10 '15 at 12:38
  • Can you check if there are any javascript errors on your page? – Cristina Alboni Apr 10 '15 at 13:01
  • Your code works just fine for me in .NET 4.5. Are you **sure** it's throwing an error on this page? – mason Apr 10 '15 at 13:36
  • Did you try to move the `ScriptManager`? – VMAtm Apr 10 '15 at 14:56
  • I did , still same error. Somehow VS does not see the scriptmanager control. – S Nash Apr 10 '15 at 15:16
  • May you can try out the `ToolkitScriptManager` as you are working with latest code of ajax toolkit? – VMAtm Apr 10 '15 at 15:33

2 Answers2

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>
Seventh Son
  • 131
  • 6
1

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.

Tawab Wakil
  • 1,737
  • 18
  • 33