Posted By

fuzzylogic on 10/27/09


Tagged

states select list state us drop down


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

neozilon
joacoleo


State Dropdown


 / Published in: VB.NET
 

Put in your base class (called GlobalClass in my case) and initiate using the two declarative objects at the bottom.

  1. Function GetStates() As Object
  2.  
  3. Dim statesList As String, states As Object
  4. statesList = ("AL,AK,AZ,AR,CA,CO,CT,DC,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")
  5. states = Split(statesList, ",")
  6. Return states
  7.  
  8. End Function
  9.  
  10.  
  11.  
  12. <asp:ObjectDataSource ID="ODS_ListStates" runat="server" TypeName="GlobalClass" SelectMethod="GetStates" />
  13. <asp:DropDownList ID="DDL_State" runat="server" DataSourceID="ODS_ListStates" />

Report this snippet  

You need to login to post a comment.