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

Fire AJAX Server event on TextChanged.

3 Answers 195 Views
Input
This is a migrated thread and some comments may be shown as answers.
Paul Buxton
Top achievements
Rank 1
Paul Buxton asked on 01 Jul 2009, 01:53 PM
Hi,

i'm trying to do the following.....

I want to validate a username is unique from a RadTextBox and handle TextChanged which calls the database.  What I subsequently need to do is get the client to display a radalert or a radwindow to display saying the name is already in use.

I have a RadAjaxManager, and enabled the textbox within it.

In textchanged handler I try to inject a radalert

RadAjaxManager1.ResponseScripts.Add("radalert('UserName is already in use!')");

but it never displays.

Is this something that is possible, or not?

Regards
Paul.



3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 02 Jul 2009, 06:10 AM
Hello Paul Buxton,

I tried the scenario and it is working fine in my side. Have you placed ScripManager/RadScriptManager before the RadAjaxManager markup?

Here is the code that I tried. Have a look on this:
aspx
 
<telerik:RadScriptManager ID="RadScriptManager2" runat="server"
</telerik:RadScriptManager> 
 
<telerik:RadAjaxManager ID="RadAjaxManager2" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="TextBox1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="TextBox1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
<telerik:RadWindowManager ID="RadWindowManager2" runat="server"
</telerik:RadWindowManager> 
 
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"
</asp:TextBox> 

cs
 
protected void TextBox1_TextChanged(object sender, EventArgs e) 
    RadAjaxManager1.ResponseScripts.Add("radalert('UserName is already in use!');"); 

-Shinu.
0
Paul Buxton
Top achievements
Rank 1
answered on 10 Jul 2009, 10:34 AM
The simplest things are the solution.  I never even realised I'd got the script manager after then manager.  I never realised it mattered.




0
Bijoy Mohanta
Top achievements
Rank 1
answered on 16 Mar 2016, 11:26 AM
01.<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" ValidateRequestMode="Enabled">
02.        <AjaxSettings>
03.             <telerik:AjaxSetting AjaxControlID="txtDeclinedByPin">
04.                <UpdatedControls>
05.                    <telerik:AjaxUpdatedControl ControlID="txtDeclinedByPin" />
06.                    <telerik:AjaxUpdatedControl ControlID="txtDeclinedByName" />
07.                    <telerik:AjaxUpdatedControl ControlID="txtDeclinedByDesignation"/>
08.                </UpdatedControls>
09.            </telerik:AjaxSetting>
10.        </AjaxSettings>
11.    </telerik:RadAjaxManagerProxy>
12. 
13. 
14.For control:
15.<telerik:RadNumericTextBox runat="server" ID="txtDeclinedByPin" OnTextChanged="txtDeclinedByPin_TextChanged1" AutoPostBack="true"></telerik:RadNumericTextBox>
hi experts this is the solution on TextChanged Event with ajaxifying
Tags
Input
Asked by
Paul Buxton
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Paul Buxton
Top achievements
Rank 1
Bijoy Mohanta
Top achievements
Rank 1
Share this question
or