Request.Url - Path Only

  • Thread starter Thread starter John Devlon
  • Start date Start date
re:
!> I need Request.Url.AbsoluteUri without the filename...

Dim fullappname as string = Request.Url.Host
Dim MyUrl As Uri = Request.Url
Dim fullappnameProtocol As String = "The full URL and protocol for the application root is : " _
& Server.HtmlEncode(MyUrl.Scheme) & "://" & fullappname & Request.ApplicationPath & "/"

That code handles both http and https URLs.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top