Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2010 DropDownList1

$
0
0
i am thinking of populating a dropdownlist with files from a local folder.
and having a button that on button click will retrieve the selected file.

Thi is my .vb what I have so far.

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
If DropDownList1.AutoPostBack Then
Dim folders = System.IO.Directory.GetDirectories("C:\folder1")
DropDownList1.DataSource = folders
DropDownList1.DataBind()
End If
End Sub

Thank you all for your help.

Viewing all articles
Browse latest Browse all 27349

Trending Articles