I can't understand the following code, can you explain me each line. Please
protected void BindGrid()
{
string[] filePaths = Directory.GetFiles(Server.MapPath("~/images/"));
List<ListItem> files = new List<ListItem>();
foreach (string filePath in filePaths)
{
files.Add(new ListItem(Path.GetFileName(filePath), filePath));
}
GridView1.DataSource = files;
GridView1.DataBind();
}
...
Go to the complete details ...