Ciao,
sono alle prime armi nello sviluppo web, qualcuno sa come si fa...
ho due dropdownlist, una popolata con i nomi di alcuni paesi e una seconda che a seconda della scelta del paese viene popolata con i nome delle città di tale paese.. il fatto è che mi sfugge qualcosa, non riesco a prendere il valore del testo della 1° combobox e passare come parametro per la seconda in modo da popolarla..
per ora ho fatto così:
# 1 DDL
codice:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
cbCountry.DataSource = objL.GetCountriesAD()
cbCountry.DataMember = "CountriesAD"
cbCountry.Enabled = True
cbCountry.DataValueField = "Countries"
cbCountry.DataTextField = "Countries"
cbCountry.DataBind()
cbCountry.AutoPostBack = True
End Sub
# 2° DDL
codice:
Protected Sub cbCountry_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbCountry.TextChanged
cbCity.DataSource = objL.GetCitiesAD( cbCountry.Text ) ' IL PARAMETRO è IL NOME DEL PAESE, CHE VIENE PRESO DALLA 1° DROPDOWNLIST
cbCity.DataMember = "CitiesAD"
cbCity.Enabled = True
cbCity.DataValueField = "Cities"
cbCity.DataTextField = "Cities"
cbCity.DataBind()
End Sub
GRAZIEEEEEEEEE