am getting the output but it displays the line that
System.Collections.Generic.List`1[System.String]
- List<ListItem> files = new List<ListItem>();
- List<String> fi = new List<String>();
- 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));
-
- fi.Add(Path.GetFileName(filePath));
- }
- }
- }
- sd.Close();
- con.Close();
- cd1.Dispose();
-
- return PartialView("gridattch",fi);
- @Model List<string>
- @{
- Layout = null;
- //<IEnumerable>
- }
- <html>
- <head>
-
- </head>
- <body>
-
- <div id="div1">
- <table>
- <tr>
- <th>File Name</th>
- <th>Link</th>
- </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() })
the output am getting but i want to remove the error(System.Collections.Generic.List`1[System.String]) on the page just see the picture