Hi,
I'm working on a web control at the moment which creates a simple form
with some fields and some labels, all on one line.
The output is fine and everything is ok, however I want to control the
space between the controls with a spacer image. Since there are 4
controls I will need 4 spacer images at 5px wide each to create a nice
even gap between each control so it doesnt look too bunched up.
I've tried creating one image control:
Dim spacer as New Image
spacer.imageurlBLAHBLAHwidth etc
and then adding this to the form between each control
Me.Controls.Add(lblUname)
Me.Controls.Add(spacer)
Me.Controls.Add(txtUname)
Me.Controls.Add(spacer)
.......... etc
However when the control is rendered it only displays the image in in
the place where it was last added.
Now I'm sure your all going to say thats how its supposed to be, which
is fine, however I would like to know how you can reuse control (like
an image control) to appear several times without having to declare a
new one each time. I'm sure its just a syntax thing, I supposed I
could just output the HTML as in:
Output.Write("{0} {1} {2}","<H2>", "Hello World", "</H2>")
But I'm kind of curious if control reuse in this way is possible.