Device Browser- The ScriptManager must appear before on page when RadCaptcha on page

2 posts, 0 answers
  1. George
    George avatar
    105 posts
    Member since:
    Oct 2014

    Posted 21 Apr 2018 Link to this post

    On Phone and Table device browsers, I get this error on two pages. 

    The control with ID '' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.InvalidOperationException: The control with ID '' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

    The two pages have one thing in common, a telerik:RadCaptcha control being used.  The one page basically is just a RadCaptcha giving access to another page.

    They work fine with normal desktop browsers, or on the device when the browser is switched to desktop mode (Chrome).

    The page has a telerik:RadScriptManager just inside the form in the Site.Master file. It is an ASP.NET application using .Master files. The RadCaptcha is at the bottom the aspx page well below the RadScriptManager definition.

    If I add an asp:ScriptManager, I get an error saying you can only have one script manager.

    My RadScriptManager call looks like this.

    <telerik:RadScriptManager ID="RadScriptManager" runat="server" CdnSettings-TelerikCdn="Enabled">
        <Scripts>
            <%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%>
            <%--Framework Scripts--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            <asp:ScriptReference Name="MsAjaxBundle" />
            <asp:ScriptReference Name="jquery" />
            <asp:ScriptReference Name="bootstrap" />
            <asp:ScriptReference Name="respond" />
            <asp:ScriptReference Name="WebFormsBundle" />             
            <%--Site Scripts--%>
        </Scripts>
    </telerik:RadScriptManager>

     

    The problem would seem to be RadCaptcha related.

     

     

  2. George
    George avatar
    105 posts
    Member since:
    Oct 2014

    Posted 21 Apr 2018 Link to this post

    Not seeing the page is hard to figure it out. Some of the other pages do not show the top menu and footer, the top of the page says Mobile Master Page.  With the missing menu could imply that the whole top is missing including the RadScriptManager declaration meaning the error message is true.  The RadCaptcha requires the declarations in RadScriptManager and they are not there.

    So, the question could now be - why do the top and bottom disappear saying Mobile Master Page?

  3. George
    George avatar
    105 posts
    Member since:
    Oct 2014

    Posted 21 Apr 2018 Link to this post

    Oh, my what a surprise. My ASP.NET application has a file called Site.Mobile.Master that apparently it used on mobile devices and some tablets.  The Mobile Master Page is in the top of the file. Four years and I never noticed it or thought it would only be used if I referred to it.

    I use BootStrap to make my website as scalable as I can, constantly resizing my window smaller to work well in all sizes. The solution then was to remove Site.Mobile.Master from the project.  I also remembered to remove it from Azure where it is deployed since Publishing does not remove files.

    It's neat how posting on a forum gets you thinking more about the problem.

Back to Top