K
Kristoffer Arfvidson
Is it possible to have multiple instances of a control and still access all
of them in codebehind?
For example, I need to be able to change an image location on a frequent
basis...
so, I decided to use <asp:image id="img_tomgif1" runat="server" enabled=true
width="1" height="2"/>
ok...
and, I put the code that changes image in the codebehind page eg...
public img_tomgif1 as image
img_tomgif1.ImageUrl=http://IMAGEURL
now, so far so good, now comes the problem, this image is repeated thruout
my homepage...
so, at first I started to place img_tomgif1 img_tomgif2 and so on, but this
soon became a mess in my code, so I decided I wanted to make multiple
instances of the image instead...
(img_tomgif (0), (1), (2))
but, since I put an id tag on my image it dosn´t work, because asp.net
requires the id tag to be unique, but how do I access the image from
codebehind if I don´t make an Id-tag?
is there a way of making multiple instances of the image and still refer to
it as a single image on the codebehind page?
(Or similair option, I think you understand what I want do to)
Yours: Kristoffer
of them in codebehind?
For example, I need to be able to change an image location on a frequent
basis...
so, I decided to use <asp:image id="img_tomgif1" runat="server" enabled=true
width="1" height="2"/>
ok...
and, I put the code that changes image in the codebehind page eg...
public img_tomgif1 as image
img_tomgif1.ImageUrl=http://IMAGEURL
now, so far so good, now comes the problem, this image is repeated thruout
my homepage...
so, at first I started to place img_tomgif1 img_tomgif2 and so on, but this
soon became a mess in my code, so I decided I wanted to make multiple
instances of the image instead...
(img_tomgif (0), (1), (2))
but, since I put an id tag on my image it dosn´t work, because asp.net
requires the id tag to be unique, but how do I access the image from
codebehind if I don´t make an Id-tag?
is there a way of making multiple instances of the image and still refer to
it as a single image on the codebehind page?
(Or similair option, I think you understand what I want do to)
Yours: Kristoffer