I have a TreeView using an XmlDataSource as the data source on a page. In SharePoint designer, the TreeView displays the data just fine. When I look on the web site, I get the error: "An unexpected error has occurred." I have configured the XmlDataSource as a SafeControl in web.config. When I create a small web site in Visual Studio and just the XML with a TreeView, everything is fine.
Other problems I've had with this:
- One day it worked fine, and the treeview was displayed and the links worked on the web site. The following day, the page was broken. It's been broken since, on two different portals on different servers.
- In SharePoint designer, I have to use a relative path to the Xml file for the XmlDataSource. If I don't, the TreeView doesn't find the file, and the Edit TreeNode DataBindings UI doesn't find any nodes.
- On the web site, I have to use the full path. If I use the relative path, I get a "File not found." error. This means that I have to change the data file name back and forth between when I do the design work and when I want to look at the page on the web site.
- In SharePoint designer, the properties (attributes) of the XML have to be in a particular order for the databindings to work. For example, <heading1 name="microsoft" url=www.microsoft.com> is not the same as <heading1 url=www.microsoft.com name="microsoft"> to SharePoint.
SharePoint Products and Technologies4