Hey All,
I have 5 pictures(.jpeg) inside one folder...How do I make all those images get displayed in my .aspx page(like a thumbnail?)?
Can I create objects of Image class inside a for loop and make it display? But in anycase I don't know how to make it display... Should I create a table and make the images to display in each cell??
Any help would be appreciated..

Thanks
Ani

Recommended Answers

All 7 Replies

html table to hold the images

How do I create html table using C#?Can you show me an example?

Thanks
Ani

You can use either the repeater control or something along those lines, or use the System.Web.UI.HtmlControls namespace with class Table();

Use HtmlTable or Table class??

Ani

Why use all those? Using server controls is costly, so a repeater would be best. Just create a repeater and bind all your images to an array, then bind it to the datasource. Basically, use the System.IO namespace, loop through each file in the directory and detect if it's a .jpg or .jpeg file, then add the path/filename to the array. After this completes, set the array to the datasource of the repeater and databind. It will automatically do the rest for you.

Thanks for your suggestion..I m really new to this ASP.Net world..Can you help me with some chunks of C# code...By datasource, do you mean a SQL database or something alike?How do I bind images to an array?Create an Image array?

Thanks
Ani

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.