Announcements
Good Day,
Please advise on how to fix this Scriptmanager error '
I used the template within Visual studio to create ASPNet Web application. On one of the page I replaced the content with
<asp:ScriptManager runat="server" /> <crm:CrmDataSource ID="Contacts" runat="server" /> <crm:CrmEntityFormView DataSourceID="Contacts" EntityName="contact" SavedQueryName="ContactForm" runat="server" />
.....But I want the contact Form to inherit design from the Master page, so I had a final code like this..........
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CRMAPP._Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager runat="server" />
<crm:CrmDataSource ID="Contacts" runat="server" />
<crm:CrmEntityFormView DataSourceID="Contacts" EntityName="contact" SavedQueryName="Create Contact Web Form" runat="server" />
</asp:Content>
But I am now getting this error message
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: Only one instance of a ScriptManager can be added to the page.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[InvalidOperationException: Only one instance of a ScriptManager can be added to the page.] System.Web.UI.ScriptManager.OnInit(EventArgs e) +600 System.Web.UI.Control.InitRecursive(Control namingContainer) +139 System.Web.UI.Control.InitRecursive(Control namingContainer) +312 System.Web.UI.Control.InitRecursive(Control namingContainer) +312 System.Web.UI.Control.InitRecursive(Control namingContainer) +312 System.Web.UI.Control.InitRecursive(Control namingContainer) +312 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +408 |
*This post is locked for comments
It fixed the issue! Thanks.
Hi Samuel,
Try removing ScriptManager from user control.
See: stackoverflow.com/.../only-one-instance-of-a-scriptmanager-can-be-added-to-the-page-in-asp-net
Only one instance of the ScriptManager control can be added to the page. The page can include the control directly, or indirectly inside a nested component such as a user control, content page for a master page, or nested master page. If a page already contains a ScriptManager control, but a nested or parent component needs additional features of the ScriptManager control, the component can include a ScriptManagerProxy control. For example, the ScriptManagerProxy control enables you to add scripts and services that are specific to nested components.
Hope this helps.
André Arnaud de Cal...
293,751
Super User 2025 Season 1
Martin Dráb
232,722
Most Valuable Professional
nmaenpaa
101,158
Moderator