This is a migrated thread and some comments may be shown as answers.

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

2 Answers 368 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 2
George asked on 21 Apr 2018, 03:49 PM

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  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  just inside the form in the Site.Master file. It is an ASP.NET application Master files. The RadCaptcha is at the bottom the  page well below the RadScriptManager definition.

If I add an aspiptManager, 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 Answers, 1 is accepted

Sort by
0
George
Top achievements
Rank 2
answered on 21 Apr 2018, 09:53 PM

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?

0
George
Top achievements
Rank 2
answered on 21 Apr 2018, 10:24 PM

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.

Tags
General Discussions
Asked by
George
Top achievements
Rank 2
Answers by
George
Top achievements
Rank 2
Share this question
or