Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports APNSoft.WebControls
Partial Public Class ComboBox_ServerSelection
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'Apply event-handling method
AddHandler myComboBox.OnItemClick, AddressOf myComboBox_OnItemClick
End Sub
Private Sub myComboBox_OnItemClick(ByVal sender As Object, ByVal e As APNSoft.WebControls.ComboBoxEventArgs)
'Get component instance
Dim myComboBox As APNSoftComboBox = CType(sender, APNSoftComboBox)
'Get clicked Item
Dim myItem As ComboBoxElement = e.ComboBoxElement
'Display clicked item data
Dim ClickedItem As String = ""
ClickedItem &= "Component ID: <b>" & _
myComboBox.ID & "</b>"
ClickedItem &= "<br/>Item ID: <b>" & _
myItem.id & "</b>"
ClickedItem &= "<br/>Item title: <b>" & _
myItem.title & "</b><br/><br/>"
lblClickedItem.Text = ClickedItem
End Sub
End Class
|