Even after almost 4 years working with ASP.NET, I can still never remember what property I need from
Request.Url. So, as much to aid my own brain as yours, here's a handy-dandy table:
If you need the whole URL, except just some bit at the end, you can use
GetLeftPart, with a value from the
UriPartial enum. The value you pass, will be the last part of the URL included. For example, to remove the fragment from the URL above:
For what it's worth,
Request.Url is just an
Uri instance. If you'd like to learn more about this system class, please see the relevant MSDN documentation.