ASP:Image vs ASP:Literal

C

C K

What is less expensive/intensive on the server -dynamically writing out my
rollovers to an asp:literal, or to use asp:image tags for the images. My
image names will be dynamic as I am building a multi-lingual site
(french/english).

Any advice would be appreciated - if there is better way to do this I'd be
open to it as well.

TIA
Clayton
 
K

Kevin Spencer

Using a LiteralControl would be less expensive, and would do everything you
have said you need to do. Using a runat=server image tag would probably be
more maintainable, and less expensive than using an asp:image tag.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
C

C K

Do you mean I can do a regular <img src="" runat=server/> ??? How would
this work and what benefits would this have over an <asp:image> tag

Thanks
Clayton
 
K

Kevin Spencer

Do you mean I can do a regular <img src="" runat=server/> ??? How would

actually - said:
this work and what benefits would this have over an <asp:image> tag

Yes, you can create an HtmlControl from any HTML element. In the case of a
regular Image tag, you would map it to an HtmlGenericControl on the server.
The benefit of it is that it has a smaller footprint (uses less resources)
than a WebControl. You don't need all the functionality that the WebControl
offers, so you should go with the Control that uses the least amount of
resources.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
C

C K

Instead of using the HTMLGenericControl, I had to use the HTMLImage control
so I could get a handle to the src attribute.

Thanks for your help!
 

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
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top