<ValidationProperty("SelectedValue")>
Public Class StatePicker
    Inherits System.Web.UI.UserControl

#Region "Properties"

    Property Enabled As Boolean
        Get
            Return ddlStates.Enabled
        End Get
        Set(value As Boolean)
            ddlStates.Enabled = value
        End Set
    End Property

    Property SelectedValue As String
        Get
            Return ddlStates.SelectedValue
        End Get
        Set(value As String)
            ddlStates.SelectedValue = value
        End Set
    End Property

    '
    ' Handy list of all states
    '
    Property states As String() = {
        "Alabama ", "Alaska ", "Arizona ", "Arkansas ", "California ", "Colorado ", "Connecticut ", "Delaware ", "Florida ", "Georgia ", "Hawaii ", "Idaho ", "Illinois", "Indiana ", "Iowa ", "Kansas ", "Kentucky ", "Louisiana ", "Maine ", "Maryland ", "Massachusetts ", "Michigan ", "Minnesota ", "Mississippi ", "Missouri ", "Montana", "Nebraska ", "Nevada ", "New Hampshire ", "New Jersey ", "New Mexico ", "New York ", "North Carolina ", "North Dakota ", "Ohio ", "Oklahoma ", "Oregon ", "Pennsylvania", "Rhode Island ", "South Carolina ", "South Dakota ", "Tennessee ", "Texas ", "Utah ", "Vermont ", "Virginia ", "Washington ", "West Virginia ", "Wisconsin ", "Wyoming"
    }
    Property abbreviations As String() = {
        "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"
    }

#End Region

#Region "Methods"

    Sub Rebind()
        ddlStates.Items.Clear()
        ddlStates.Items.Add(New ListItem())
        For i = 0 To UBound(states)
            Dim name = states(i)
            Dim abbreviation = abbreviations(i)
            ddlStates.Items.Add(New ListItem(name, abbreviation))
        Next
    End Sub

#End Region

#Region "Internals"

    Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
        If Not Page.IsPostBack Then
            Rebind()
        End If
    End Sub

#End Region

End Class