Hello
I am having 2 combo boxes (dropdownlists) on ASPX Page. If value is changed in first dropdownlist, values in 2nd dropdownlist should be changed accordingly. For this I am trying to write Event Handling Code.
But it is giving me error
Compiler Error Message: BC30506: Handles clause requires a WithEvents variable.
Code is as follows :
Sub ddlChiiki_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlChiiki.SelectedIndexChanged
Dim AL as ArrayList = new ArrayList()
Dim Temp1, Temp2 as string
If File.Exists(csvPath & sCSVFileName) = True Then
Try
' Open the file to read from.
sr = File.OpenText(csvPath & sCSVFileName)
sr.ReadLine()
Do While sr.Peek() >= 0
Dim txtTemp=Split(sr.ReadLine(), txtDelimiter)
Temp1 = txtTemp(1)
Temp2 = txtTemp(3)
If ddlChiiki.SelectedItem.Text = Temp1 Then
AL.Add(Temp2)
End If
Loop
sr.Close()
ddlPam1.DataSource = AL
ddlPam1.DataBind()
Catch x As Exception
Response.Write(x.ToString())
End Try
End If
End Sub
<asp:DropDownList id="ddlChiiki" runat="server" OnSelectedIndexChanged="ddlChiiki_SelectedIndexChanged" AutoPostBack="True" Width="120px"></asp:DropDownList>
Pls suggest something earliest.
[What is exact meaning of Handles, AddHandler, etc. ?]
Thanks
Mahesh
