iterate over all images in a page

J

jd

Question from an ASP.Net newbie: using ASP.Net 2.0, how can I iterate
over all the images in a page? The reason: I need to tweak the URLs
for each image (I need to insert an "order id" field so that the proper
image is selected). Thanks...

-- jeff
 
I

intrader

Question from an ASP.Net newbie: using ASP.Net 2.0, how can I iterate
over all the images in a page? The reason: I need to tweak the URLs
for each image (I need to insert an "order id" field so that the proper
image is selected). Thanks...

-- jeff
Let's give it a try. Assuming that all your images are displayed by an asp
control (server control), you can derive a new control inherited from the
sasp.net control and override the render method. You can then do as you
wish in one place without a loop.
Otherwise, you may loop though the controls finding image controls and
change their attributes.
 

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
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top