Current URL

  • Thread starter Thread starter Badass Scotsman
  • Start date Start date
B

Badass Scotsman

Hello,

I would like to display the current directory which an ASPX file sits
within, and display the result on page.

For example:

www.test.com/hello/test.aspx would return:
www.test.com/hello

And
www.test.com/hello/goodbye/test.aspx would return:
www.test.com/hello/goodbye

Also
www.test.com/hello/goodbye/seeyousoon/hi.aspx would return:
www.test.com/hello/goodbye/seeyousoon

I have tried lots, Request.URL, Request.PathInfo, Request.Path etc etc, none
of them work as they all want to return the FileName too :)

Gary.
 
You should also look at the Request.Url property which is a Uri with many
properties you might find useful, such as Path and such..

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top