Hello, i tryin to find some code to handle some situation in webpage using C# and asp.net. I have site with membership, every user have a folder with his name (if UserName is xxyyxx so the folder have the same name xxyyxx) the folder contain lots of images. i want to display all images in a repeater from the user folder by the username. the images is not records inDB all the images upload by the site manager to the folder by FTP. the code need to display the images by the url request query string (the user name) any Idea?

I have used IO and Collection classes,

.aspx markup

<form id="form1" runat="server">
    <div>
        <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate>
         <asp:Image ID="img1" runat="server" ImageUrl='<%#Eval("Key")%>' />
        </ItemTemplate>
        </asp:Repeater>
    </div>

.cs - code behind

protected void Page_Load(object sender, EventArgs e)
    {
        string username = "xxyyxx";
        Dictionary<string,string>  t=System.IO.Directory.GetFiles(MapPath(username)).ToDictionary(p => username + "/" + System.IO.Path.GetFileName(p));
        Repeater1.DataSource = t;
        Repeater1.DataBind();
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.