Rebinding to an XmlDataSource in .NET 2.0
by galen on Oct.06, 2006, under Development
This damn problem had me baffled for an entire wasted day. I had a simple XmlDataSource binding to a GridView. However when changes to the data source were made, the gridview seemed to retain its databinding to the previous datasource.
The problem lay with the XmlDataSource control having the EnableCaching property set to True by default. Toggeling this option resolved the issue. Thankyou .NET for a wasted day of development.
Dim xmlDs As New XmlDataSource
With xmlDs
.EnableCaching = False
.Data = XMLHelper.SerializeObjectToXML(LeadMgmtController.Data.Data, GetType(Leads), True)
.XPath = “LeadViews/LeadView”
.TransformFile = “~/xslt/leadview.xslt”
.DataBind()
End With