sethu
sethu

Reputation: 229

Does referring single image file many times on a page impacts performance?

I am referencing one single image icon 100s of times in a Grid on an ASP.NET page in C# code behind. Is this the right way to do it or using CSS sprite and Css class and rendering the image is better? Which one is preferred over the other and are there any other better ways of doing this?

Upvotes: 0

Views: 23

Answers (1)

Rahul
Rahul

Reputation: 4364

asp.net/c# is server side language it will execute code on server and then it will send to users browser

and css is client side so this will perform its task on client browser, so it is always good idea to referencing img via css using class or id, you can also use css sprites to reduce server request

you can also leverage browser caching in IIS so next time user don't need to download that image

Upvotes: 1

Related Questions