I’m using VB to generate a tree menu from an xml file. The problem is that if the xml file is not found then the page blows up. I don’t want this to happen. We are using contribute, so if a person generates a draft, which is moved to a draft folder, the xml file is not there. I need a way for a default message to display when the xml file is not found instead of the page blowing up. Thanks a bunch. I’m really new to .Net, so sorry if this is a noob question:P
<form runat="server">
<asp:XmlDataSource ID="MySource" DataFile="xml/links.xml" XPath="MSCHome/links[@name='menu']/*" runat="server"/>
<asp:TreeView
Id="MyTree"
DataSourceId="MySource"
SkinId="MSDN"
OnSelectedNodeChanged="MyTree_Select"
NodeStyle-ForeColor="Black"
NodeStyle-Font-Names="Verdana"
NodeStyle-Font-Size="8pt"
NodeStyle-HorizontalPadding="5"
NodeIndent="10"
ExpandDepth="0"
runat="server">
<Databindings>
<asp:TreeNodeBinding DataMember="links" TextField="name" />
<asp:TreeNodeBinding DataMember="mainlink" TextField="name" NavigateUrlField="url"/>
<asp:TreeNodeBinding DataMember="link" TextField="name" SelectAction="Expand"/>
<asp:TreeNodeBinding DataMember="sub" TextField="name" NavigateUrlField="url" />
</Databindings>
</asp:TreeView>
</form>