Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
How can I tell which page the user is asp.net
for sample:
user location in site
home>forum>page1
root node>parent node>current node

how do it?
tnx
Posted

Unless your pages are arranged in folders that mimic exactly the logical layout of your pages, then no, you can't do it - there is no requirement that "this page must be a parent of that page" and nothing to enforce such a relationship. A page can be accessed from a huge number of other pages even within the same site.

If you do arrange them in folders - which would be unusual - then you can probably get the relationship from request.PhysicalPath[^] and parsing the string it returns.

But probably, you are trying to do something a bit odd and it is unlikely to work exactly as you expect. What are you trying to achieve by doing this?
 
Share this answer
 

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