Home - Forums-.NET - FlyTreeView (ASP.NET) - refresh a flynodeset control... empty cache ?

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

refresh a flynodeset control... empty cache ?
Link Posted: 27-Oct-2005 20:02
Hi all !
i'm using a flynodeset cnotrol in order to load data in a flytreeview, and sometimes i have to delete or move some nodes. When the user clicks on a button which is created in a node, a javascript function is called , and the page is postbacked . In server side, the application detects the event, and deletes/moves the pointed element in my database. Then i would like to refresh my treeview from the data stored in database, but the flynodeset seems to keep the xml in cache. Is it possible to empty this cache ?
i've tried to add this code on each page ([treeview].aspx and [nodeset.aspx]) to empty asp.net cache but i doesn't work better :
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");
Response.ExpiresAbsolute = DateTime.Now.Date;
Response.Expires = -1;

Setting a new nodesrc for my treeview doesn't work too...

any idea?
thanks
Link Posted: 27-Oct-2005 21:56
I think the problem is not in browser cache.
Actually the FlyTreeView keeps the nodes into viewstate once they are loaded. And thus, when you set the FlyTreeView.NodeSr, nodes are actually loaded only once and are added to the viewstate of treeview.
But anyway you may always clear the nodes collection at postback and nodes will be repopulated using NodeSrc again:

FlyTreeView1.Nodes.Clear();

Hope this is what you need.
Link Posted: 09-Nov-2005 21:27
Thanks for the rely, now it works
thank you !