if (Request.QueryString.Count > 0) { string[] filePaths = Directory.GetFiles(Server.MapPath("~/DistributorShopImages/" )); List<listitem> files = new List<listitem>(); foreach (string filePath in filePaths) { string fileName = Path.GetFileName(filePath); files.Add(new ListItem(fileName, "~/DistributorShopImages/" + fileName)); } DataList1.DataSource = files; DataList1.DataBind(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)