Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a repeater in which I place <asp:Image> in which

C#
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Path") %>'


Path in the Container.Dataitem is the URL of the images which shown in repeater and URL makes a string with the help of select query and images uploaded bynamically

There will be almost 140 images which will be load in asp repeater and it takes 20 second to load all images ..but my requirement is to manage it to 5 to 6 seconds...

As well as i observed some solution like you could use AJAX to load them one at a time. You can then control the order in which they are loaded (eg load top 10 first, then load next 10). Similar to how Facebook does photo uploads. But how i use it...? means which extender i use

Do you guys have any solution
Posted
Updated 11-Dec-13 20:28pm
v2
Comments
Harshil_Raval 12-Dec-13 1:56am    
When you upload image, create small size of thumbnail image and show that images in repeater, it will surly improve your page performance. Also don't show all 140 images in repeater at a time. create custom paging to display images.

if is physical image you can check image weight, if the image is too heavy you can edit it with Photoshop and choose the option "save image for web"
 
Share this answer
 
All your code does is generates HTML that is sent back to the browser. The URL in ImageUrl of the image object is just the src attribute of the image tag.
<img src="imageUrl" />

So you have to look at this in 3 views

1. How long does it take to generate the HTML or run the program.
2. How large is the HTML block that is being sent back to the browser
3. How long does the browser take to populate the image url's to complete the page request.


1. If it takes a long time to generate the code, you have to optimize the code to run faster.

2. If the HTML being sent back to the browser is too large, and takes a long time, you have to write more efficient or compact HTML to reduce the size.

3. If the browser takes forever to download each image, then you need to make the images smaller in file size.

3A. To reduce the image file size, you compress the image using the JPEG format, and select a lower quality, or make the image size smaller. If your using PNG at 24, then the images will be huge in file size.

3B. You can also show less images in the HTML, let's say 10 per page, and build an index system to take the current page and chop it up into 10 pages.

3C. Sometimes it's a matter of perception. You change the display of your interface to make it more interactive, in which you show a thumbnail of the image, and you have to click to see the large version. Not everybody wants to see every image, so they can choose.

Finally

It's called lazyload, a J Query plugin, that will use the browsers window position, to determine when to download the images. So when the windows area becomes visible, the image downloads.

Personally, it's just comes from experience in GUI and program designs, in which you create programs that satisfy the users perception of speed.
 
Share this answer
 
You can refer the below link and use the same approach .

http://aspsnippets.com/Articles/Load-data-while-Scrolling-Page-down-with-jQuery-AJAX-and-ASPNet.aspx[^]

Hope this helps you...
 
Share this answer
 
Comments
faizan aziz 12-Dec-13 7:19am    
good one but not appropriate for me...i m looking for images... any suggestion for images
JoCodes 12-Dec-13 22:33pm    
Read the article carefully . You can implement the same with images also.This is a sort of Lazy or on demand loading where the ajax call takes care of the loading as per the Count of records.
faizan aziz 21-Dec-13 3:09am    
I used lazy load ,,well it's work only in div...but when i put a div in asp panel..lazy loading is not working..i mean it shows image normally without any effect..help...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900