user1467175
user1467175

Reputation: 287

Only one instance of a ScriptManager can be added to the page

"Only one instance of a ScriptManager can be added to the page." this error appear when I added the script Manager to the password strength of AJAX toolkit.

i added the password strength beside the password field of my createuserwizard. why this error would appear when this is the only scriptmanager that i had in my website?

here is the code:

 <asp:TextBox runat="server" ID="Password" TextMode="Password" MaxLength="20" />
<asp:ScriptManager ID="ScriptManager2" runat="server">
</asp:ScriptManager>
 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate> 
 <asp:PasswordStrength ID="Password_PasswordStrength" runat="server" 
                                Enabled="True" TargetControlID="Password"   DisplayPosition="RightSide"
                             StrengthIndicatorType="BarIndicator"
                              BarBorderCssClass="barBorder"
                               BarIndicatorCssClass="barInternal">
                         </asp:PasswordStrength>

                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator10" ControlToValidate="Password" 
                                ErrorMessage="Password is required." />   
      </ContentTemplate> </asp:UpdatePanel> 
                        </td>
                    </tr>

Upvotes: 3

Views: 17552

Answers (2)

nunespascal
nunespascal

Reputation: 17724

Just remove this ScriptManager and it will work fine.

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

You have definitely added a ScriptManager somewhere else in your Page or MasterPage.

ScriptManager Control Overview

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.

Upvotes: 5

DerApe
DerApe

Reputation: 3175

Maybe your Masterpage has a Scriptmanager too? Check your whole aspx page hierarchy...

Upvotes: 3

Related Questions