Solved

ASP Master Pages TreeView XML Display in Contentplaceholder?

Posted on 2008-10-08
2
432 Views
Last Modified: 2012-05-05
I'm using the following 'Bookstore' XML file with ASP Master Pages.
I have a TreeView in the Left div and a contentplaceholder in the right div.
So far the TreeView reads the XML file very well.

Q. How do I display the XML Book, Chapter, Abstract in the contentplaceholder?

<?xml version="1.0" encoding="utf-8" ?>
<Bookstore>
  <genre name="Business">
    <book ISBN="BU1032" Title="The Busy Executive's Database Guide" Price="19.99">
      <chapter num="1" name="Introduction">
        Abstract...
      </chapter>
      <chapter num="2" name="Body">
        Abstract...
      </chapter>
      <chapter num="3" name="Conclusion">
        Abstract...
      </chapter>
    </book>
    <book ISBN="BU2075" Title="You Can Combat Computer Stress!" Price="2.99">
      <chapter num="1" name="Introduction">
        Abstract...
      </chapter>
      <chapter num="2" name="Body">
        Abstract...
      </chapter>
      <chapter num="3" name="Conclusion">
        Abstract...
      </chapter>
    </book>
    <book ISBN="BU7832" Title="Straight Talk About Computers" Price="19.99">
      <chapter num="1" name="Introduction">
        Abstract...
      </chapter>
      <chapter num="2" name="Body">
        Abstract...
      </chapter>
      <chapter num="3" name="Conclusion">
        Abstract...
      </chapter>
    </book>
  </genre>
</Bookstore>
0
Comment
Question by:pointeman
2 Comments
 
LVL 18

Accepted Solution

by:
David Robitaille earned 500 total points
ID: 22668857
Well, the content placeholder is where your web page (the page that is using the masterpage) will be display.
is you are trying to display something in the master page, dont put it in the content placeholder.
if you are tying to access the masterpage s content from the web page, here a link:
http://www.asp.net/learn/master-pages/tutorial-06-vb.aspx 
0
 

Author Comment

by:pointeman
ID: 22670279
Typo, I do have a default.aspx page opening in the contextplaceholder.
Added the following to the TreeView, displays XML better:

<DataBindings>
<asp:TreeNodeBinding DataMember="book" ValueField="ISBN" TextField="Title" NavigateUrl="~/Default.aspx"/>
<asp:TreeNodeBinding DataMember="chapter" ValueField="num" TextField="name"/>
</DataBindings>
</asp:TreeView>
 None-the-less, still need to open another XML file in the default.aspx via a TreeView click. Here's the new XML:

<Bookstore>
<genre name="Business">
<book ISBN="BU1032" Title="The Busy Executive's Database Guide" Price="19.99" Dir="another.xml">
<chapter num="1" name="Introduction">
Abstract...
</chapter>
<chapter num="2" name="Body">
Abstract...
</chapter>
<chapter num="3" name="Conclusion">
Abstract...
</chapter>
</book>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now