<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ 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></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Label1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function ClientSelectedIndexChanged(sender, eventArgs) {
                if (eventArgs.get_item().get_value() == "SpecialItem") {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequestWithTarget("<%= RadComboBox1.UniqueID %>",
                        '{"Command":"Select","Index":' + eventArgs.get_item().get_index() + '}');
                }
            }
        </script>
        </telerik:RadCodeBlock>
    </div>
    <telerik:RadComboBox ID="RadComboBox1" runat="server" CausesValidation="False" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
        OnClientSelectedIndexChanged="ClientSelectedIndexChanged">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="SpecialItem" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" Value="RadComboBoxItem3" />
        </Items>
    </telerik:RadComboBox>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <br />
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
        ErrorMessage="*"></asp:RequiredFieldValidator>
    </form>
</body>
</html>
