Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用带有 .NET Web 表单的路由。(.NET 4.0)
页面如何找出实际的 URL 是什么?
例如,在以下 URL:
/路由/友好的网址/
我希望页面打印出来:
/文件夹/mypage.aspx
使用Page.AppRelativeVirtualPath.
Page.AppRelativeVirtualPath
例子:
<body> Path to ASPX: <%= Page.AppRelativeVirtualPath %> </body>