[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

System.Web.UI.WebControls.XmlDataSource caching puzzle

Stephen MarcAurele

10/26/2006 5:51:00 AM

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?


4 Answers

Akram

11/10/2006 11:19:00 PM

0


"Stephen MarcAurele" <smarcaurele@gmail.com> wrote in message
news:%23wSadKM%23GHA.4980@TK2MSFTNGP04.phx.gbl...
>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?
>
>

An Dang

11/20/2006 4:34:00 AM

0

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,


*** Sent via Developersdex http://www.develop... ***

athos

11/27/2006 3:58:00 AM

0

me 3.

I cannot believe my eyes....

An Dang wrote:

> 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,
>
>
> *** Sent via Developersdex http://www.develop... ***

athos

11/27/2006 4:04:00 AM

0

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.

athos wrote:

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