Problem facing in generating image gallery...whr i am doing wrong??

Posted by Rickeybglr under ASP.NET on 8/10/2012 | Points: 10 | Views : 533 | Status : [Member] | Replies : 0
Hi All,

i am creating an image gallery. and on web pages i am getting all the images(image path is displaying instead of thumbnail) but when i click on the image to view it, a blank screen is open.
public void viewGallery(string fldNamePath)
{
try {
DirectoryInfo myImageDir = new DirectoryInfo(Server.MapPath("~/images/UsersGallery/" + fldName)); //fldName is the folderName in which images are stored
DataTable dt = new DataTable();
dt.Columns.Add("col");
foreach (FileInfo file in myImageDir.GetFiles())
{
DataRow dr = dt.NewRow();
dr["col"] = Server.MapPath("~/images/UsersGallery/") + fldName + "\\" + file.Name;
dt.Rows.Add(dr);
DLImz.DataSource = dt;
DLImz.DataBind();
}
}
ASPX code:
<script type="text/javascript">
$(function () {
$("a[rel^='prettyPhoto']").lightBox();
});
</script>
-----some code-----
<asp:Panel ID="UPGallery" runat="server">
<asp:DataList ID="DLImz" runat="server" RepeatColumns="5">
<ItemTemplate>
<a href='<%# Eval("col")%>' rel="prettyPhoto[pp_gal]" title="caption">
<img src='<%# Eval("col")%>' width="60" height="60" alt='<%# Eval("col") %>' />
</a>
</ItemTemplate>
</asp:DataList>




Responses

(No response found.)

Login to post response