Solved

ASP Master Pages TreeView XML Display in Contentplaceholder?

Posted on 2008-10-08
2
437 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

832 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