I would like to remove the last segment of Request.Url, so for instance...
Request.Url
http://www.example.com/admin/users.aspx/deleteUser
To remove the last segment of Request.Url it is enough to subtract from absolute uri the length of last segment.
string uriWithoutLastSegment = Request.Url.AbsoluteUri.Remove( Request.Url.AbsoluteUri.Length - Request.Url.Segments.Last().Length );