<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpdateControlWithAJAXDependingOnClickedToolbarButtonCS_WebUI.aspx.cs" Inherits="UpdateControlWithAJAXDependingOnClickedToolbarButtonCS_WebUI" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
        <asp:Label ID="Label1" runat="server" Text="Click 'New' button as many times as you want to add new items and then click 'Save' to udpated the CheckBoxList"></asp:Label>    
        <telerik:RadToolbar ID="RadToolbar1" runat="server" style="z-index: 103; left: 204px; position: absolute; top: 39px" 
         OnButtonClick="RadToolbar1_OnClick">
            <Items>
                <telerik:RadToolbarButton runat="server" Text="New" CommandName="New"/>
                <telerik:RadToolbarButton runat="server" Text="Save" CommandName="Save"/>
            </Items>
        </telerik:RadToolbar>
    
        <asp:CheckBoxList ID="CheckBoxList1" runat="server" style="z-index: 101; left: 251px; position: absolute; top: 91px" Height="51px" Width="26px">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
        </asp:CheckBoxList>
        <asp:ListBox ID="ListBox1" runat="server" style="z-index: 102; left: 204px; position: absolute; top: 87px" Height="191px" Width="34px">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
        </asp:ListBox>
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  >
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadToolbar1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="CheckBoxList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadToolbar1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ListBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </div>
    </form>
</body>
</html>