I am trying to pass a Filename from server side to a XmlDatasource ...
This works
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile='~/DataFiles/test.xml' XPath="/ITEMS/item"></asp:XmlDataSource>
However passing the file name from server side always results in the error "Illegal characters in the path"
Have tried the following
asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile='<%=FullPath %>' XPath="/ITEMS/item"></asp:XmlDataSource>
asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile='~/DataFiles/<%=FileName %>' XPath="/ITEMS/item"></asp:XmlDataSource>
asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/DataFiles/'<%=FileName %>'" XPath="/ITEMS/item"></asp:XmlDataSource>
Any suggestions