Treeview and SiteMapPath Question ?

Last post 02-03-2008 3:34 PM by bizsoftasp. 9 replies.

Sort Posts:

  • Treeview and SiteMapPath Question ?

    02-01-2008, 12:51 AM
    • Member
      3 point Member
    • scm22ri
    • Member since 06-10-2007, 9:14 PM
    • Posts 105

    Hi Everyone,

    I have a question in regards to the treewiew and sitemappath. On this page http://www.greatratesfinancial.com/Admin.aspx a sitemappath is present (this page is template) and this page http://www.greatratesfinancial.com/Landing-Page-Practice-2.aspx also has a sitemappath but it dosen't appear on the top of the page. Would anyone know why ?

    Thanks

  • Re: Treeview and SiteMapPath Question ?

    02-01-2008, 2:52 AM
    • Member
      283 point Member
    • carterwjeff
    • Member since 07-19-2006, 7:37 PM
    • London, ON Canada
    • Posts 85

    Sitemap path does not have to appear on the top of a page.  Actually a sitemappath doesn't appear on a page at all... Only its content on a different control.  ASP.Net knows of its existence before compiling the control that uses it.

  • Re: Treeview and SiteMapPath Question ?

    02-01-2008, 10:49 AM
    • Member
      3 point Member
    • scm22ri
    • Member since 06-10-2007, 9:14 PM
    • Posts 105

    Hi,

    Thanks for the response but on this page http://www.greatratesfinancial.com/Admin.aspx you can view the sitemappath and on this page you can't http://www.greatratesfinancial.com/Landing-Page-Practice-2.aspx

    How do I get my visitors to view the sitemappath on the second page ?

    Thanks

  • Re: Treeview and SiteMapPath Question ?

    02-01-2008, 9:13 PM
    • Member
      283 point Member
    • carterwjeff
    • Member since 07-19-2006, 7:37 PM
    • London, ON Canada
    • Posts 85

    Could I see the working code and then the nonworking code of just the stuff needed to show your treeview.

  • Re: Treeview and SiteMapPath Question ?

    02-01-2008, 9:25 PM
    • Member
      3 point Member
    • scm22ri
    • Member since 06-10-2007, 9:14 PM
    • Posts 105

    Hi,

    Thanks for the response. The working code is on this page

    http://www.greatratesfinancial.com/Admin.aspx

     the non working code is on this page

    http://www.greatratesfinancial.com/Landing-Page-Practice-2.aspx

    Please advise. Thank you.

  • Re: Treeview and SiteMapPath Question ?

    02-02-2008, 1:08 AM
    • Member
      80 point Member
    • bizsoftasp
    • Member since 01-27-2008, 11:59 AM
    • Posts 17

    Hi, 

    I can only see the results (no source code) from these two URLs, and from the "view source" it seems that the admin.aspx uses the master page, while the Landing-Page-Practice-2.aspx does not use the master page. Although you have the SiteMapPath server controls in both pages. But it seems the SiteMapDataSource control in Landing-Page-Practice-2.aspx is different from the one in Admin.aspx. If you use the web.sitemap as the datasource, please make you that the url and title attributes in sitemapnode are correct. If you use the master page that includes the site map path, you should not have such problem. For example, I use the site map path in the master page for this web site http://www.aspexception.com. The site map path is displayed consistently for all pages of this web site.

    If you can post the code of those two pages, I will be happy to take a look at them.

  • Re: Treeview and SiteMapPath Question ?

    02-02-2008, 10:47 AM
    • Member
      3 point Member
    • scm22ri
    • Member since 06-10-2007, 9:14 PM
    • Posts 105

    Hi,

    Thanks for the reply. I appreciate it. The source code is below for the two pages.

    http://www.greatratesfinancial.com/Landing-Page-Practice-2-vb.aspx 

    I had to change the name of the page from landing-page-practice-2.aspx       to       landing-page-practice-2-vb.aspx

    The source code is for the below pages for landing-page-practice-2-vb.aspx is below

     

     

    <%@ Page Language="VB" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

    </script> <html xmlns="http://www.w3.org/1999/xhtml" >

    <head id="Head1" runat="server">

    <title>MasterPages Demo</title>

    <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> </head>

    <body leftmargin="0" topmargin="0">

    <form id="form1" runat="server">

    <div><table border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td colspan="2" style="border-bottom: olive thick solid; height: 46px; background-color: darkgray">

    <img align="absmiddle" src="Images/logo.gif" />

    <asp:SiteMapPath ID="SiteMapPath1" runat="server">

    </asp:SiteMapPath>

    </td>

    </tr>

    <tr>

    <td colspan="1" style="width: 169px; height: 54px; border-bottom: silver thin solid; text-align: center;">

    <img src="Images/home.gif" /></td>

    <td colspan="1" style="height: 54px; width: 100%; border-bottom: silver thin solid;">

    <h2 style="text-align: center">MasterPages Demo</h2>

    </td>

    </tr>

    <tr>

    <td style="vertical-align: top; width: 169px; height: 300px; background-color: lightgrey">

    <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" ImageSet="Arrows">

    <ParentNodeStyle Font-Bold="False" />

    <HoverNodeStyle Font-Underline="False" ForeColor="#5555DD" BackColor="Yellow" />

    <SelectedNodeStyle Font-Underline="False" ForeColor="#5555DD" Font-Bold="True" />

    <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="5px"

    NodeSpacing="0px" VerticalPadding="0px" />

    </asp:TreeView>

    </td>

    <td style="vertical-align: top">

    </td>

    </tr>

    <tr>

    <td colspan="2" style="height: 40px">

    Copyright © 2005 Some Company, Inc.</td>

    </tr>

    </table>

    </div>

    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />

    </form> </body>

    </html>

     

     

     

     

     

     

    The admin page is run on the masterpage so I will provide you with the code to the masterpage. Thats below.

     

     

     

    http://www.greatratesfinancial.com/Admin.aspx

    <%@ Master Language="VB" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

    </script> <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title>MasterPages Demo</title>

    <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> </head>

    <body leftmargin="0" topmargin="0">

    <form id="form1" runat="server">

    <div><table border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td colspan="2" style="border-bottom: olive thick solid; height: 46px; background-color: darkgray">

    <img align="absmiddle" src="Images/logo.gif" />

    <asp:SiteMapPath ID="SiteMapPath1" runat="server">

    </asp:SiteMapPath>

    </td>

    </tr>

    <tr>

    <td colspan="1" style="width: 169px; height: 54px; border-bottom: silver thin solid; text-align: center;">

    <img src="Images/home.gif" /></td>

    <td colspan="1" style="height: 54px; width: 100%; border-bottom: silver thin solid;">

    <h2 style="text-align: center">MasterPages Demo</h2>

    </td>

    </tr>

    <tr>

    <td style="vertical-align: top; width: 169px; height: 300px; background-color: lightgrey">

    <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" ImageSet="Arrows">

    <ParentNodeStyle Font-Bold="False" />

    <HoverNodeStyle Font-Underline="False" ForeColor="#5555DD" BackColor="Yellow" />

    <SelectedNodeStyle Font-Underline="False" ForeColor="#5555DD" Font-Bold="True" />

    <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="5px"

    NodeSpacing="0px" VerticalPadding="0px" />

    </asp:TreeView>

    </td>

    <td style="vertical-align: top">

    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

    </asp:ContentPlaceHolder>

    </td>

    </tr>

    <tr>

    <td colspan="2" style="height: 40px">

    Copyright © 2005 Some Company, Inc.</td>

    </tr>

    </table>

    </div>

    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />

    </form> </body>

    </html>

     

     Thanks

     

  • Re: Treeview and SiteMapPath Question ?

    02-03-2008, 10:25 AM
    Answer
    • Member
      80 point Member
    • bizsoftasp
    • Member since 01-27-2008, 11:59 AM
    • Posts 17

    Hi scm22ri,

    I went through the source code of those two pages. It seems two pages are quite similar. The only reason I can guess is that "landing-Page-Practice-2-vb.aspx" is not in you web.sitemap (if you use web.sitemap as your datasource). For instance, you should have the following line in web.sitemap:

    <siteMapNode url="~/Landing-Page-Practice-2-vb.aspx" title="Practice 2" description="Page Practice 2">

    Please check you web.sitemap file to make sure you have Landing-Page-Practice-2-vb.aspx in your site map file.

  • Re: Treeview and SiteMapPath Question ?

    02-03-2008, 2:43 PM
    • Member
      3 point Member
    • scm22ri
    • Member since 06-10-2007, 9:14 PM
    • Posts 105

    Hi !

    Thanks for the reponse, its now working !

    but the page that I added "Landing Page Practice" is bold or perhaps that just my computer ? does it appear bold on your computer ?

    (sorry for my lack of  terminology }

    and also, I've always wanted to learn how to adjust where each words appears on the page. I'm assuming that needs to be done in the web.sitemap page. What I want to do is this, if I want "landing page practice vb" in the same view point as "Administration" How would do that ?

     Below I've provided the source code for the web.sitemap

    Thanks for your help !

    <?
    xml version="1.0" encoding="utf-8" ?>

    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <siteMapNode title="Home" url="Default.aspx">

    <siteMapNode title="Login" url="Login.aspx" />

    <siteMapNode title="Create Account" url="CreateAccount.aspx" />

    <siteMapNode title="Administration" url="Admin.aspx">

    <siteMapNode title="Manage Accounts" url="ManageAccounts.aspx" />

    <siteMapNode title="Display Reports" url="DisplayReports.aspx" />

    <siteMapNode title="Landing Page Practice" url="Landing-Page-Practice-2-VB.aspx" />

    </siteMapNode>

    </siteMapNode>

    </siteMap>

  • Re: Treeview and SiteMapPath Question ?

    02-03-2008, 3:34 PM
    • Member
      80 point Member
    • bizsoftasp
    • Member since 01-27-2008, 11:59 AM
    • Posts 17

    1. I did not see the page in bold. If you want to control the appearance, you can change the style for the site map path

    2. If you want the "landing page practice" page at the parallel level with Administration page, you can move the sitemapnode for landing page out of administration node.

    <siteMapNode title="Administration" url="Admin.aspx">

    <siteMapNode title="Manage Accounts" url="ManageAccounts.aspx" />

    <siteMapNode title="Display Reports" url="DisplayReports.aspx" />

    </siteMapNode>

    <siteMapNode title="Landing Page Practice" url="Landing-Page-Practice-2-VB.aspx" />

Page 1 of 1 (10 items)