# .Net xml tree view question

**URL:** <https://forum.kirupa.com/t/net-xml-tree-view-question/215589>\
**Category:** programming\
**Created:** [February 8, 2007, 2:10pm UTC](https://forum.kirupa.com/t/net-xml-tree-view-question/215589 "2007-02-08T14:10:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SlowRoasted](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SlowRoasted](https://forum.kirupa.com/u/SlowRoasted)\
**Post date:** [February 8, 2007, 2:10pm UTC](https://forum.kirupa.com/t/net-xml-tree-view-question/215589/1 "2007-02-08T14:10:13Z")

</div>

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

```php

<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>

```
