Saturday, 5 November 2011

URL properties of HttpContext.Current.Request.Url in ASP.NET


The following attributes are some of the useful properties of the URL object. I use the following URL to send my request to localhost:
Ex URL: http://localhost/Test/Home.aspx?test=fine
And I get the following results:
  1.  AbsolutePath = /Test/Home.aspx
  2. AbsoluteUri = http://localhost/Test/Home.aspx?test=fine
  3. Authority = localhost
  4. DnsSafeHost = localhost
  5. Fragment = “”
  6. Host = localhost
  7. HostNameType= Dns
  8. IsAbsoluteUri = True
  9. IsFile = False
  10. LocalPath = /Test/Home.aspx
  11. OriginalString = http://localhost:80/Test/Home.aspx?test=fine
  12. PathAndQuery = /Test/Home.aspx?test=fine
  13. Port = 80
  14. Query = ?test=fine
  15. Scheme = http
  16. UserEscaped = False
  17. UserInfo = “”

1 comment: