tags:

views:

82

answers:

2

hey all,

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

+1  A: 

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

   <asp:ScriptManager id="ScriptManager1" runat="server">
   </asp:ScriptManager>
Corey Sunwold
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 !!
c11ada
Delete Me Please
Jammin
Look through the aspx page and double check that there isn't a second ScriptManager somewhere below your update panel.
Corey Sunwold
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 ??
c11ada
If you read here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.autopostback.aspx the postback will only occur when the textbox loses focus. It won't postback everytime the value of the textbox changes.
Corey Sunwold
A: 

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.

Jammin
im not using a master page,
c11ada