访问用户的当前位置 [英] Visit user's current location

查看:134
本文介绍了访问用户的当前位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何判断用户是哪个页面是asp.net

样本:

网站中的用户位置

home>论坛>第1页

根节点>父节点>当前节点



怎么做?

tnx

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

推荐答案

除非你的页面被安排在模仿你网页逻辑布局的文件夹中,否则你不能这样做 - 没有要求这个页面必须成为该页面的父母并没有强制执行这种关系。即使在同一个站点内,也可以从大量其他页面访问页面。



如果你把它们安排在文件夹中 - 这很不寻常 - 那你就可以可能从 request.PhysicalPath [ ^ ]并解析它返回的字符串。



但是,你可能正在尝试做一些有点奇怪的事情,它不可能完全像你期望的那样工作。你想通过这样做来实现什么?
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?


使用ASP.NET站点地图 [ ^ ]



使用Sitemap和MasterPage的ASP.NET菜单 [ ^ ]


这篇关于访问用户的当前位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆