title: How to get ScriptManager to work with ScriptmanagerProxy
body: <p>I have been dealing with an unusual set of errors when I try to compile my asp.net page. This page is inheriting from my masterpage. It should be getting the Scriptmanager from there. But the errors I am getting suggest that it is not.</p>
  
  <p>Now I have this in my page:</p>
  
  <pre><code>    &lt;%@ Page Title="MassUpdate" Language="C#"
           MasterPageFile="~/Site1.Master"
           AutoEventWireup="true"
           CodeBehind="Update.aspx.cs"
           Inherits="AdminSite.Update"
           MaintainScrollPositionOnPostback="true" %&gt;
  
  
       &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server" &gt;
  
          &lt;div id="contentarea"&gt;
              &lt;div&gt;
                  &lt;h3 style="color:Red; padding-left:5px;"&gt;
                      WARNING - This page can push large amounts of data into the database. Use care when using it!
                  &lt;/h3&gt;
              &lt;/div&gt;    
  
  
          &lt;asp:ScriptManagerProxy runat="server"  &gt;
  
          &lt;/asp:ScriptManagerProxy&gt;
  </code></pre>
  
  <p>And in my masterpage, I have this:</p>
  
  <pre><code>&lt;body&gt;
      &lt;header&gt;
         &lt;div id="banner"&gt;
  
              &lt;h1 style="color:#DBFFFF"&gt;UAC Parts Admin&lt;/h1&gt;    
      &lt;/div&gt;
  &lt;/header&gt;
  &lt;form id="form1" runat="server"&gt;
  
  &lt;div id="container"&gt;
  
      &lt;asp:ContentPlaceHolder ID="MainContent" runat="server"&gt;
  
  
      &lt;/asp:ContentPlaceHolder&gt;
      &lt;asp:LoginView ID="LoginView1" runat="server" EnableViewState="false"&gt;
          &lt;LoggedInTemplate&gt;
        &lt;div id="menubar"&gt;
  
          &lt;h6&gt;Reports&lt;/h6&gt;
          &lt;div&gt;
              &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
                  &lt;Scripts&gt;
                      &lt;asp:ScriptReference Path="~/Scripts/jquery.js" /&gt;
                      &lt;asp:ScriptReference Path="~/Scripts/jqueryui.js" /&gt;
                      &lt;asp:ScriptReference Path="~/Scripts/menubar.js" /&gt;
                  &lt;/Scripts&gt;
              &lt;/asp:ScriptManager&gt;
  </code></pre>
  
  <p>The  first error is this: </p>
  
  <blockquote>
    <p>The control with ID '' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.</p>
  </blockquote>
  
  <p>It happens when I don't have ScriptManager on my page and use ScriptManagerProxy instead.Even though I have ScriptManager on my Master page.</p>
  
  <p>Now when I put a ScriptManager on my page I get a different error.</p>
  
  <blockquote>
    <p>Only one instance of a ScriptManager can be added to the page.</p>
  </blockquote>
  
  <p>What do I need to do to get this to work?
  Is this an issue with one of my Nuget Packages? (JuiceUI,Widgmo, etc)</p>
  
  <p>I would be glad to post code if requested.</p>
  
  <p><strong>EDIT:</strong>
  Yeah, this whole thing has been weird. Oddly the master page did not have issues itself. But only when the other pages used it did I have any problems. Moving it to the first element after the form tag was the solution I believe. Though I had also moved the ScriptManagerProxy up a bit in my code too.</p>