locked
Script Manager timeout? RRS feed

  • Question

  • User1510859543 posted

    I am getting the error below and it only seems to happen if the page is dormant for a while.  The ScriptManager control is in the master page.  Is there a setting to avoid this error?

    The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
    
     Stack Trace:
       at System.Web.UI.UpdatePanel.get_ScriptManager()
       at System.Web.UI.UpdatePanel.RegisterPanel()
       at System.Web.UI.UpdatePanel.OnInit(EventArgs e)
       at System.Web.UI.Control.InitRecursive(Control namingContainer)
       at System.Web.UI.Control.InitRecursive(Control namingContainer)
       at System.Web.UI.Control.InitRecursive(Control namingContainer)
       at System.Web.UI.Control.InitRecursive(Control namingContainer)
       at System.Web.UI.Control.InitRecursive(Control namingContainer)
       at System.Web.UI.Control.InitRecursive(Control namingContainer)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    

    Tuesday, August 29, 2017 4:46 PM

All replies

  • User-335504541 posted

    Hi dlchase,

    Please add the ScriptManager to your page before the 'UpdatePanel1',

    For example:

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"></asp:UpdatePanel>

    Best Regards,

    Billy

    Wednesday, August 30, 2017 1:57 AM
  • User1510859543 posted

    That does not work because there is already a scriptmanager on the master page.

    Wednesday, August 30, 2017 12:02 PM
  • User-335504541 posted

    Hi dlchase,

    Do you add your scriptmanager  before your 'UpdatePanel1' ?

    For example:

    The master page:

        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:ContentPlaceHolder ID="BodyContentPlaceHolder" runat="server">        
            </asp:ContentPlaceHolder>        
        </div>
        </form>

    Or could you show me your code?

    Best Regard,

    Billy

    Thursday, August 31, 2017 1:42 AM
  • User1510859543 posted

    Yes.  The ScriptManager is near the top of the master page and below it is this.

            <div class="container body-content">
                <asp:ContentPlaceHolder ID="MainContent" runat="server">
                </asp:ContentPlaceHolder>
                <hr />
                <footer id="mstrfoot">
                    <p>&copy;  2017 - Purchasing Application<br />Designed 2017 by LifeTime Computing, Inc.</p>
                </footer>
            </div>
    

    The odd thing is that it does not throw an error unless the page is open and inactive for a while. Is there a timeout that is causing this?

    Thursday, August 31, 2017 1:03 PM
  • User475983607 posted

    dlchase

    Yes.  The ScriptManager is near the top of the master page and below it is this.

    I don't see a script manager in the posted code.

    The script manager looks like this...

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

    dlchase

    The odd thing is that it does not throw an error unless the page is open and inactive for a while. Is there a timeout that is causing this?

    Perhaps the site went idle.  The AJAX request (Update Panel) cause a null reference execution due to the use of Session.  Or maybe an authentication token expired and the site tried to redirect to the login page.  

    Look in the Event Viewer for unhanded errors.  

    Or perhaps the script manager is not above the Update Panel?

    Thursday, August 31, 2017 1:52 PM
  • User1510859543 posted

    Below is markup above what I sent.

            <asp:ScriptManager runat="server">
                <Scripts>
                    <%--To learn more about bundling scripts in ScriptManager see https://go.microsoft.com/fwlink/?LinkID=301884 --%>
                    <%--Framework Scripts--%>
                    <asp:ScriptReference Name="MsAjaxBundle" />
                    <asp:ScriptReference Name="jquery" />
                    <asp:ScriptReference Name="bootstrap" />
                    <asp:ScriptReference Name="respond" />
                    <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
                    <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
                    <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
                    <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
                    <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
                    <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
                    <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
                    <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
                    <asp:ScriptReference Name="WebFormsBundle" />
                    <%--Site Scripts--%>
                </Scripts>
            </asp:ScriptManager>
    
    

    Thursday, August 31, 2017 1:57 PM
  • User-335504541 posted

    Hi dlchase,

    I think you could try to move the ScriptManager from master page to content page.

    Or could you show me your all related code so that I can help you to find the reason?

    Best Regards,

    Billy 

    Friday, September 1, 2017 7:14 AM