954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

image not displayed in datalist

Hii,
i have a datalist in my page containing a image button as item template.The design page is as follows

th ecode behind is as follows
public void attachimages()
{
int i;
strgrt="bday";
string[] FileArray;
DataTable dlist = new DataTable();
dlist.Columns.Add("filename");
dlist.Columns.Add("picture");
System.IO.DirectoryInfo folder = new System.IO.DirectoryInfo(Server.MapPath("~\\source\\Live\\student\\" + strgrt + "\\small\\"));
FileArray = System.IO.Directory.GetFiles(Server.MapPath("~\\source\\Live\\student\\ecards\\" + strgrt + "\\small\\"));
for (i = 0; i <= FileArray.Length - 1; i++)
{
DataRow r = dlist.NewRow();
r[0] = (string)FileArray[i];
r[1] = "Picture" + Convert.ToString(i + 1);
dlist.Rows.Add(r);
}
ds.Tables.Add(dlist);

ddlist.DataSource = ds;

ddlist.DataBind();
}
iam not able to get the images displayed but iam getting the exact no of images displayed in the page present in the folder.need u r help as soon as possible

greeny_1984
Posting Whiz
372 posts since Apr 2007
Reputation Points: 25
Solved Threads: 29
 

HII,
i have solved it myself ,the problem was with my image url ,where i have left space after by bithday e-cards.i have removed the spaces and make it birthday-cards and it is working fine

greeny_1984
Posting Whiz
372 posts since Apr 2007
Reputation Points: 25
Solved Threads: 29
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You