ASP:Image vs ASP:Literal

  • Thread starter Thread starter C K
  • Start date Start date
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
 
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.
 
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
 
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.
 
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!
 
Back
Top