I will take a hit on this without seeing your code:
Check out the ASP: Repeater control. Meanwhile, binding your data (with your deviations) to it can do what you want.
Link 1 Link 2
<Edit:> Okay, now that I see your code, I can help you better. I would definitely use a repeater for this. I would do it as in an ASPX file (I might have some errors):
<ASP:Repeater id="MyRepeater" runat="server"> <div> <img src="<%# Eval("Filename")>" alt="<$# Eval("AltText")>" /> </div> </ASP:Repeater>
Then in your C # you could:
List<ObjectWithFilenameAndAltText> foo = GoGetTheseObjects(); MyRepeater.DataSource = foo; MyRepeater.DataBind();
I may have some mistakes in this, but I hope this will make you move in the right direction. If you donβt have a dedicated object for your images, you can simply use a dictionary or list> and use the βkeyβ and βvalueβ in your ASPX code.
source share