Imports Telerik.Web.UI

Partial Class _Default
    Inherits System.Web.UI.Page

    Dim updatedControls As Hashtable = New Hashtable()

    Protected Sub RadAjaxManager1_AjaxSettingCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxSettingCreatedEventArgs) Handles RadAjaxManager1.AjaxSettingCreated
        updatedControls.Add(e.Updated.ID, e.Initiator.ID)
        Session("upCon") = updatedControls
    End Sub

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
        Dim ctrlId As String = CType(sender, DropDownList).ID
        Dim entry As DictionaryEntry
        Dim htable As Hashtable = CType(Session("upCon"), Hashtable)

        For Each entry In htable
            If entry.Value = ctrlId Then
                RadAjaxManager1.Alert("Updated control: " + entry.Key)
            End If
        Next

        UpdateControls()
    End Sub
    Protected Sub UpdateControls()
        ListBox1.Items.Clear()
        ListBox1.Items.Add(New ListItem(DropDownList1.SelectedItem.Text))

        Label1.Text = DropDownList1.SelectedItem.Text
    End Sub
End Class
