iterate over all images in a page

  • Thread starter Thread starter jd
  • Start date Start date
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
 
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

Back
Top