am getting the output but it displays the line that
System.Collections.Generic.List`1[System.String]
- List
files = new List(); - List
fi = new List (); - string dpath = Path.GetDirectoryName(Server.MapPath("~/Files/"));
- while (sd.Read())
- {
- if (sd["attachmentname"] != DBNull.Value)
- {
- ss = "\\" + sd["attachmentname"].ToString();
- s1 = dpath + ss;
- }
- foreach (string filePath in filePaths)
- {
- if (filePath.Equals(s1))
- {
- files.Add(new ListItem(Path.GetFileName(filePath), filePath));
- // files.Add(Path.GetFileName(filePath));
- fi.Add(Path.GetFileName(filePath));
- }
- }
- }
- sd.Close();
- con.Close();
- cd1.Dispose();
- // List
ls=files.ToList ; - return PartialView("gridattch",fi);
- @Model List<string>
- @{
- Layout = null;
- //<IEnumerable>
- }
- <html>
- <head>
- head>
- <body>
- <div id="div1">
- <table>
- <tr>
- <th>File Nameth>
- <th>Linkth>
- tr>
- @for (var i = 0; i <= Model.Count - 1; i++)
- {
- <tr>
- <td>
- @Model[i].ToString()
- td>
- <td>
- @Html.ActionLink("Download", "Download", new { selectedfilename = @Model[i].ToString() })
ejaz mirzaPosted Apr 6, 2018, 6:26 AM
Nanddeep NachanPosted Apr 4, 2018, 1:20 AM
ejaz mirzaPosted Apr 4, 2018, 12:25 AM
Manav PandyaPosted Apr 2, 2018, 11:52 AM