TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ejaz mirza
NA
471
47.2k
System.Collections.Generic.List`1[System.String]
Apr 2 2018 6:41 AM
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));
// files.Add(Path.GetFileName(filePath));
fi.Add(Path.GetFileName(filePath));
}
}
}
sd.Close();
con.Close();
cd1.Dispose();
// List<String> ls=files.ToList<String>;
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
Reply
Answers (
4
)
How to show pagination according to total row count in lates
Resume sharing using Asp.net MVC