How dynamically declare Image controls in a web form?

G

Guest

I want to display image information and images in a web form. The problem is
that I do not know how many images in a directory, but I have to display all
images in the directory into the web form. Before display images, I have a
static design of labels and textboxes for information (GridLayout). So there
is a position to consider as well. I have try to use Response.Write to set up
a table for this popurse, but the table is positioned at the first line
before anything else. Now I consider to use Image objects. But I have no idea
about it. Anyone could give me help? Thank you.

David
 
A

agapeton

This is really simple... you just need to create a server control to do
all the work for you. I do this A LOT. I never do anything myself; I
just have a huge library of assistants and controls to do whatever I
need. For the web, server controls area Godsend!

Instead of walking you through it though, just take a gander at the
below video. Using .NET 2.0/C#, you should be able to do this in no
time at all with little to no explantion (ergo, the beauty of .NET
2.0). Seriously... just take a stab at it. Your code will practically
fall together.

http://channel9.msdn.com/Showpost.aspx?postid=122122

As far as the flow...you want to use the proper XHTML elements. Things
in a list are basically collections and the XHTML collection element is
the ul and it's item is the li. Things in a dictionary basically map
to the dl where dt is the key and dd is the item. If you are doing a
simple image list, then you can use <ul><li><img src="" alt=""
/></li></ul>, but if you want an associated peice or set of information
(title or all image info) you may want to use
<dl><dt></dt><dd></dd></dl>. Using tables is absolutely out of the
question as they are deprecated for layouts (that is...learn CSS before
you even do anything with ASP.NET 2.0)

David Betz
http://www.davidbetz.net/winfx/
http://www.davidbetz.net/dynamicbliss/
http://www.getfirefox.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top