0

im making a username availability check in ASP.net using ajax updatepanel, but i keep getting the following error

The control with ID 'UserNameUP' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.]

im using the create user wizard, to create a new user but i want to check if the user already exists, i have the following code in the aspx file

<asp:UpdatePanel runat="server" ID="UserNameUP">
 <ContentTemplate>
 <asp:TextBox ID="UserName" runat="server" Width="200px" AutoPostBack="true"  OnTextChanged="Username_Changed"></asp:TextBox></ContentTemplate> </asp:UpdatePanel><br /> 

but i keep getting that error, can any one help

thanks

2 Answers 2

1

Before your update panel, make sure you have a scriptmanager:

   <asp:ScriptManager id="ScriptManager1" runat="server">
   </asp:ScriptManager>
Sign up to request clarification or add additional context in comments.

4 Comments

do i not put anything in the asp:ScriptManager ?? im getting a new error now "Only one instance of a ScriptManager can be added to the page." but the thing is i dont have another instance !!
Look through the aspx page and double check that there isn't a second ScriptManager somewhere below your update panel.
i moved the asp:ScriptManager to the top of the form, just after <form id="form1" runat="server">, but now im having a problem with the OnTextChanged="Username_Changed" not being called, any ideas ??
If you read here: msdn.microsoft.com/en-us/library/… the postback will only occur when the textbox loses focus. It won't postback everytime the value of the textbox changes.
0

Do you have a script manager inside a master page? That can cause the "Only one instance of a ScriptManager can be added to the page" error?

Or, if its DNN, there is one on each "page" by default.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.