DropDown Event Related Query
-
Hi Friends , I have 2 dropdown on my webpage . I am taking the index value from one dropdown using javascript , so i have make the AutoPostback Event property off for that dropdown control . Now , i want to fill the another dropdown , by filtering on the basis of value selected from first dropdown. Can you please guide me , for above problem? Thanking You, Param
param
-
Hi Friends , I have 2 dropdown on my webpage . I am taking the index value from one dropdown using javascript , so i have make the AutoPostback Event property off for that dropdown control . Now , i want to fill the another dropdown , by filtering on the basis of value selected from first dropdown. Can you please guide me , for above problem? Thanking You, Param
param
You can write following code on SelectedIndexChanged event of first dropdown list. and then load the data based on first dropdown's detail. and in second drop down keep AutoPostback off. /***************************** Code ************************************* Protected Sub Dropdown1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles SelectCmpCmb.SelectedIndexChanged Dim str As String str = "Select CompanyName from Company where CompanyName = '" & dropdown1.Text & "'" (Name of your first dropdown list) dropdown2.DataSource = dbaccess.ExecuteDataReader(str) dropdown2.DataTextField = "GroupName" dropdown2.DataBind() End Sub Note : Here dropdown1 is name of first dropdown list. and dropdown2 is name of second dropdown list. I hope this will help you.