I have a .cs file that builds an xml document and stores it in a variable.
I want to "inject" it into my <asp:XmlDataSource>
so that I do not have to save each xml file (it is different every load). How could I go about this?
In my codebehind cs file, I have:
XmlDocument x = blahblah
XmlDataSource MySource = new XmlDataSource();
MySource.Data = x.InnerXml
On my aspx file I have in a form tag:
<asp:XmlDataSource ID="MySource" runat="server" >
</asp:XmlDataSource>
<asp:TreeView ID="TreeView1" DataSourceId="MySource" runat="server" />
Yet when I run this I get the easy: Object reference not set to an instance of an object