Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / November 2006

Tip: Looking for answers? Try searching our database.

System.Web.UI.WebControls.XmlDataSource caching puzzle

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen MarcAurele - 26 Oct 2006 06:50 GMT
I am embarrassed to admit that the caching features of the XmlDataSource
control have completely defeated me.  I've been trying to understand how
caching works with this control for over two days now and just when I form a
theory it gets blown out of the water by some additional observed behavior.

Specifically, the Framework documentation states that:

If you change the value of the Data property, the DataSourceChanged event is
raised. If caching is enabled and you change the value of Data, the cache is
discarded.

That does not appear to be the case.  I have a page that contains an
XmlDataSource control that uses the Data property as a source of data.  The
default caching settings are in effect (Caching enabled without expiration).
When I load this page and detect a change in the data I set the Data
property to the updated XML and then bind the control to a treeView.  Unless
I set EnableCaching to false the updated XML set in the Data property is not
reflected in the treeView.

This is just one of many caching issues that I don't understand with the
XmlDataSource control.  I'm sure that caching for this control works fine if
you know what you are doing, but from the Framework documentation I can't
figure it out.  With the caching features shrouded in mystery at this point
I unfortunately feel that all I can do is disable caching altogether.

So, if anyone can shed any light on the specific issue highlighted above or
if anyone knows of a good explanation of caching in 2.0 datasource controls
(either on the internet or in print) I would be very grateful.

Thanks much,

- Steve

PS - This is unrelated to caching, but of the Data property the framework
documentation also states, "The value of the Data property is stored in view
state."  I've also found this to not be the case.  The Data property is
always string.Empty on postbacks.  Is it me?
Akram - 10 Nov 2006 23:18 GMT
>I am embarrassed to admit that the caching features of the XmlDataSource
>control have completely defeated me.  I've been trying to understand how
[quoted text clipped - 35 lines]
> view state."  I've also found this to not be the case.  The Data property
> is always string.Empty on postbacks.  Is it me?
An Dang - 20 Nov 2006 04:34 GMT
Hi Stephen,

You are not alone. I am another victim of XmlDataSource. I had the same
problem and finally I had no choice than disabling the caching feature
completely.

Please let me now if you have further info.

Cheers,
athos - 27 Nov 2006 03:57 GMT
me 3.

I cannot believe my eyes....

> Hi Stephen,
>
[quoted text clipped - 7 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
athos - 27 Nov 2006 04:03 GMT
OK, I got it, add one more line as;

     myXDS.EnableCaching = false;

yes, even if u dynamically declare a XmlDataSource (as i do to bind a
tree), you need to declare this immidiately after instantiation.

> me 3.
>
> I cannot believe my eyes....

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2012 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.