我想用DataList显示指定文件夹里的图片,但是显示不出来。请大家帮我看看代码哪里有问题并加以改正。前台页面:
<asp:DataList ID="dlShowImg" runat="server" RepeatColumns="5" RepeatDirection="Horizontal" CellSpacing="25">
                                         <ItemTemplate>
                                                <img alt="" src="<%# Eval("FullName") %>" border="0" width="100" height="100" />
                                         </ItemTemplate>
                                    </asp:DataList>后台cs文件:
string url = System.Web.HttpContext.Current.Server.MapPath(Request.ApplicationPath + "/testImages");            DirectoryInfo di = new DirectoryInfo(url);
            dlShowImg.DataSource = di.GetFiles("*.jpg");            dlShowImg.DataBind();di.GetFiles("*.jpg"):这个中读出的是所有文件夹中的内容,其中FullName表示该图片的地址