G
Guest
Using Visual Studio 2005 SP1 I am attempting to dynamically load a treeview
control.
I create an XmlDataSource and then load the data source using
XmlDataSource.Data. I Load my XML string into this property using the code
shown below. However if I change the values in the XML string that I am
loading into XmlDataSource.Data and then run the web, the changes do not show
up. The only way to get the changes to show up is to rebuild the solution.
Am I doing something wrong or is something being cached somewhere that I am
not aware of? Is there a way to cause the changes to be reflected correctly
just by pressing F5 and letting the web run?
Thanks,
Leslie
XmlDataSource xds = new XmlDataSource();
xds.Data = @"<?xml version=""1.0"" encoding=""iso-8859-1""?>
<books1 title=""My books"" Nav=""simple.aspx"">
<computerbooks1 Nav=""simple.aspx"">
<book title=""Secrets of Silicon Valley"" author=""Sheryl
Hunter"" Nav=""simple.aspx"" />
<book title=""Straight Talk About Computers"" author=""Dean
Straight"" Nav=""simple.aspx""/>
<book title=""You Can Combat Computer Stress!"" author=""Marjorie
Green"" Nav=""simple.aspx""/>
</computerbooks1>
<cookbooks Nav=""simple.aspx"">
<book title=""Silicon Valley Gastronomic Treats"" author=""Innes
del Castill"" Nav=""simple.aspx""/>
</cookbooks>
</books1>"
;
TreeNodeBinding tnbBooks = new TreeNodeBinding();
tnbBooks.DataMember = "books1";
tnbBooks.Depth = 0;
tnbBooks.TextField = "title";
//tnbBooks.NavigateUrlField = "Nav";
TreeNodeBinding tnbBook = new TreeNodeBinding();
tnbBook.DataMember = "book";
tnbBook.TextField = "title";
tnbBook.Target = "_self";
tnbBook.NavigateUrlField = "Nav";
TreeView5.DataBindings.Add(tnbBook);
TreeView5.DataBindings.Add(tnbBooks);
TreeView5.DataSource = xds;
TreeView5.DataBind();
control.
I create an XmlDataSource and then load the data source using
XmlDataSource.Data. I Load my XML string into this property using the code
shown below. However if I change the values in the XML string that I am
loading into XmlDataSource.Data and then run the web, the changes do not show
up. The only way to get the changes to show up is to rebuild the solution.
Am I doing something wrong or is something being cached somewhere that I am
not aware of? Is there a way to cause the changes to be reflected correctly
just by pressing F5 and letting the web run?
Thanks,
Leslie
XmlDataSource xds = new XmlDataSource();
xds.Data = @"<?xml version=""1.0"" encoding=""iso-8859-1""?>
<books1 title=""My books"" Nav=""simple.aspx"">
<computerbooks1 Nav=""simple.aspx"">
<book title=""Secrets of Silicon Valley"" author=""Sheryl
Hunter"" Nav=""simple.aspx"" />
<book title=""Straight Talk About Computers"" author=""Dean
Straight"" Nav=""simple.aspx""/>
<book title=""You Can Combat Computer Stress!"" author=""Marjorie
Green"" Nav=""simple.aspx""/>
</computerbooks1>
<cookbooks Nav=""simple.aspx"">
<book title=""Silicon Valley Gastronomic Treats"" author=""Innes
del Castill"" Nav=""simple.aspx""/>
</cookbooks>
</books1>"
;
TreeNodeBinding tnbBooks = new TreeNodeBinding();
tnbBooks.DataMember = "books1";
tnbBooks.Depth = 0;
tnbBooks.TextField = "title";
//tnbBooks.NavigateUrlField = "Nav";
TreeNodeBinding tnbBook = new TreeNodeBinding();
tnbBook.DataMember = "book";
tnbBook.TextField = "title";
tnbBook.Target = "_self";
tnbBook.NavigateUrlField = "Nav";
TreeView5.DataBindings.Add(tnbBook);
TreeView5.DataBindings.Add(tnbBooks);
TreeView5.DataSource = xds;
TreeView5.DataBind();