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

Partial Public Class ComboBox_UpdatePanel
    Inherits System.Web.UI.Page

    'Global variables
    Protected Shared Skin As String = ""
    Protected Shared [Structure] As String = ""


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim sm As ScriptManager = ScriptManager.GetCurrent(Page)

        'Set defaults
        If sm.IsInAsyncPostBack = False AndAlso Page.IsCallback = False AndAlso Page.IsPostBack = False Then
            Skin = "Classic"
            [Structure] = "Default.xml"
        End If

        'Check defaults
        If Skin = "" Then
            Skin = "Classic"
        End If
        If [Structure] = "" Then
            [Structure] = "Default.xml"
        End If

        BuildControl()
    End Sub


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
        Skin = "GrayScale"
        [Structure] = "Default.xml"
        BuildControl()
    End Sub


    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
        Skin = "AOL"
        [Structure] = "Search.xml"
        BuildControl()
    End Sub


    Private Sub BuildControl()
        myComboBox.SkinFolder = "~/ComboBox/Skins/" & _
            Skin
        myComboBox.StructureFileURL = "~/ComboBox/Structures/" & _
            [Structure]
        myComboBox.DataBind()
    End Sub

End Class