Home - Forums-.NET - FlyTreeView (ASP.NET) - Images Load On Every Click and Postback

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Images Load On Every Click and Postback
Link Posted: 10-Nov-2005 18:25
This may have been somewhat addressed by a previous post but I wasnt clear on the answer.

I have a tree with a fairly large number of nodes in total (~22,000) and we are using the load on demand feature by setting the node source and loading the nodes that way.

This solution works quite well and the data itself returns very quickly, however when you expand a node with many child nodes, the data loads and shows quickly but the +- images take a long while to load.

To see an example of what I am talking about go to your demo site and use the default style and navigate to the Program Files directory and you will see that it returns the list of data pretty quickly but it takes quite a while to load these images.  

On the lower left corner of the browser you can see that the browser is reloading these images for every node every single time.  I would think that once the images are loaded then they would not need to be reloaded for every single node.  

First Why does this happen?  

second what is the solution to make this not happen? (i.e. is it a browser setting, or a IIS setting that will eliminate this behavior?)

I assume since the problem exists on your demo site as well that it is not an IIS issue since I would assume you would have made any IIS caching enabled to eliminate this if it were possible.

We have implemented our production system using your control and this is really causing a problem for our users.  We did not see it during development or testing because the images load across our internal network very quickly, however across the internet they are not very quick to load.

Please advise.

Thanks,
Mike M
Link Posted: 10-Nov-2005 21:10
Actually the reason of such behavior is in browser cache implementation.

Internet Explorer stops caching images (even per page) when it has its cache full. And just deleting the cached files in its Options typically helps in the situation.

But anyway this is a good idea to precache images of treeview somewhere in the beginning of your page (Javascript should be ok).

And also you should make sure you do not have any special settings for the client runtime files location at IIS that may cause to expire its contents to often.

So from my point of view you should begin with your browser settings to make sure it caches content.
Link Posted: 11-Nov-2005 00:04
Would it be possible for you to post a brief example of how to pre-load the images on the page via javascript?

I am not quite sure how this would be of benefit since there are really only 2 images a + image and a - image unless I was pre-loading every image for every node to be rendered and somehow via javascript showing those in the tree.
Link Posted: 11-Nov-2005 00:12
I just changed my IE settings under Tools->Internet Options, then Temporary Internet Files->Settings and changed it from

Every visit to the page option to the Automatically option

and the images do not reload as I described.  This seems to be a reasonable solution for this particular problem.  I am hoping that the setting doesnt cause problems elsewhere in my application but that is my problem not yours...

Thanks for your help with this matter.

Mike M