Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
Hi all

I entered all details of pages in xml.but one page sitemap not coming as i mean.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <!--<siteMapNode url="~/EmployeePortal/Index.aspx" title="Home"  description="Home" >-->
  <siteMapNode url="~/User/UserApplications.aspx" title="Applications"  description="Applications">
   <siteMapNode url="~/User/TicketDashboard.aspx" title="Ticketing Dashboard"  description="Ticketing Dashboard" >
     <siteMapNode url="~/User/Ticket_Details.aspx" title="Ticket Details"  description="Ticket Details" />
      <siteMapNode url="~/User/NewTicket.aspx" title="Create Ticket"  description="Create Ticket"/>
     <siteMapNode url="~/User/My_Tickets.aspx" title="My Tickets"  description="My Tickets">
       <siteMapNode url="~/User/Ticket_Details.aspx?page=1" title="Ticket Details"  description="Ticket Details" />

     </siteMapNode>

     </siteMapNode>


  </siteMapNode>
</siteMap>
In this case apperaing as
applications<ticketing dashboard< ticket details but i want sitemap as
applications<ticketing dashboard<my tickets< ticket details why its not coming by my code
Thanks in advance
Amrutha
Posted
Updated 27-Nov-12 17:26pm
v6

Do you mean like this???


ASP
<sitemap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
  <!-- <siteMapNode url="~/EmployeePortal/Index.aspx" title="Home"  description="Home" >  -->
  <sitemapnode url="~/User/UserApplications.aspx" title="Applications" description="Applications">
    <sitemapnode url="~/User/TicketDashboard.aspx" title="Ticketing Dashboard" description="Ticketing Dashboard">
      <sitemapnode url="~/User/My_Tickets.aspx" title="My Tickets" description="My Tickets">
        <sitemapnode url="~/User/NewTicket.aspx" title="Create Ticket" description="Create Ticket" />
        <sitemapnode url="~/User/Ticket_Details.aspx?page=1" title="Ticket Details" description="Ticket Details" />
      </sitemapnode>
    </sitemapnode>
  </sitemapnode>
</sitemap>
 
Share this answer
 
v2
Comments
amritha444 27-Nov-12 23:31pm    
hi thanks for the response im redirecting to same page from different pages .for eg from different pages there is navigation to ticket details page.when going from dashboard to ticketdetails site map as applications>dashboard>ticketdetails.but i have another page my tickets from this page when im navigating to ticket details page it appearing as applications>dashboard>ticketdetails.instead i want applications>dashboard>My tickets>ticketdetails
Zaf Khan 28-Nov-12 3:20am    
Hello Again Amritha444,

I think its not working because you would need a separate xml sitemap for each file page.

How do you generate your xml site map?
Do you generate it each time a new page is loaded?
because ultimately the paths to the various folders will change based upon the current location within the website.
amritha444 28-Nov-12 4:02am    
hi Zaf
I placed sitemap in master page.My issue is that i cant show correct path when navigate to samepage ticket details from differnt pages. only first navigation path follows
Hello Amritha444,

Yes I understood your problem and it seems to me like you have one XML file which you use for navigation throughout your website, (Q1 - is this right?)

And that the XML data in the sitemap XML file does not change (because you are using fixed or fully qualified paths, (Q2 - is this right too?)

If you answer YES to both the questions 1 and 2 above then the problem is not in your XML site map but in the code your using to decode, decipher or extract the information from your sitemap XML URL attribute

What are your answers to the questions (Q1 and Q2) above?
Do you answer YES and YES? to both questions?

If you do then you should post your code that you use to extract the information from the XML file and build the link to the target or destination page.


I would hazard a guess that you answer Yes to both the questions because your paths (url attribute of sitemapnodes) are fixed or fully qualified.

Therefore there are no errors in your XML FILE but in the method you use to convert the data from the URL into a page link.
 
Share this answer
 
Comments
amritha444 29-Nov-12 6:07am    
Hi Zaf
Yes i have used one xml file for entire application
Yes sitemap path not changes when going from different pages.
this is the sitemap used in master page
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:SiteMapPath ID="SiteMap1" runat="server" Font-Names="Verdana"
Font-Size="0.9em" PathSeparator=" > ">
<PathSeparatorStyle Font-Bold="True" ForeColor="#990000" />
<currentnodestyle forecolor="#6699ff">
<nodestyle font-bold="True" forecolor="#990000">
<rootnodestyle font-bold="True" forecolor="#003300">
i already explained about xml.
Zaf Khan 29-Nov-12 13:49pm    
Hello Amritha444,

Im not sure if im choosing the correct words to explain, but let me try again.

Because you are using fully qualified paths like below:
"~/folder/folder/filename.php"
or
"~/folder/folder/filename.aspx"
there is no problem with the links.
If the page exists in the folder named it should be displayed
if not, then you will likely get a 404 error.

And because they are fully qualified, they are valid for use anywhere in your website regardless of the location (contrary to what i said earlier - sorry for misunderstanding your problem).

Keep in mind that the sitemap control only allows navigation backwards up the hierarchy of the map it does not permit forward traversing to a node lower down in the map.

<quote>
Quote from MSDN Website
Link to Msdn
The SiteMapPath control enables users to navigate backward — from the current page to pages that are higher in the site hierarchy. However, the SiteMapPath control does not enable users to navigate forward — from the current page to another page that is lower in the site hierarchy.


So are you traversing backwards/upwards all the time when clicking a link?
or are you attempting to traverse forwards to a node lower down your list?

You can modify the link at runtime in memory by using the relavant method:
How to: Programmatically Modify Site-Map Nodes in Memory

To modify the path you use the SitemapResolve event which is documented here

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900