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

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 27072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>