Edit this page

Assign Different Client Events for Different Controls

In order to assign different client-events to different AJAX-enabled controls, you can use the approach shown in Example 1 .

Example 1: You can determine the target control of the AJAX request using the client-side events of the RadAjaxManager.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <telerik:AjaxSetting AjaxControlID="Button1">
                <telerik:AjaxUpdatedControl ControlID="Label1" />
        <telerik:AjaxSetting AjaxControlID="DropDownList1">
                <telerik:AjaxUpdatedControl ControlID="Label1" />
    <ClientEvents OnRequestStart="Start" OnResponseEnd="End" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">

                function Start(sender, arguments) {
                    if (arguments.EventTarget == "<%= Button1.UniqueID %>") {
                    if (arguments.EventTarget == "<%= DropDownList1.UniqueID %>") {
                function End(sender, arguments) {
                    if (arguments.EventTarget == "<%= Button1.UniqueID %>") {
                    } if (arguments.EventTarget == "<%= DropDownList1.UniqueID %>") {

This way the DropDownList and the Button will have different client-events although they are using the same RadAjaxManager or RadAjaxPanel .

See Also

Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article