Get Paths and URL fragments from the HttpRequest object

Input: http://localhost:96/Cambia3/Temp/Test.aspx?q=item#fragment

Some HttpRequest path and URL properties:
Request.ApplicationPath: /Cambia3
Request.CurrentExecutionFilePath: /Cambia3/Temp/Test.aspx
Request.FilePath: /Cambia3/Temp/Test.aspx
Request.Path: /Cambia3/Temp/Test.aspx
Request.PathInfo:
Request.PhysicalApplicationPath: D:\Inetpub\wwwroot\CambiaWeb\Cambia3\
Request.RawUrl: /Cambia3/Temp/Test.aspx?query=arg
Request.Url.AbsolutePath: /Cambia3/Temp/Test.aspx
Request.Url.AbsoluteUri: http://localhost:96/Cambia3/Temp/Test.aspx?query=arg
Request.Url.Fragment:
Request.Url.Host: localhost
Request.Url.Authority: localhost:96
Request.Url.LocalPath: /Cambia3/Temp/Test.aspx
Request.Url.PathAndQuery: /Cambia3/Temp/Test.aspx?query=arg
Request.Url.Port: 96
Request.Url.Query: ?query=arg
Request.Url.Scheme: http
Request.Url.Segments: /Cambia3/Temp/Test.aspx

Input: http://localhost:96/Cambia3/Temp/Test.aspx/path/info?q=item#fragment

Some HttpRequest path and URL properties:
Request.ApplicationPath: /Cambia3
Request.CurrentExecutionFilePath: /Cambia3/Temp/Test.aspx
Request.FilePath: /Cambia3/Temp/Test.aspx
Request.Path: /Cambia3/Temp/Test.aspx/path/info
Request.PathInfo: /path/info
Request.PhysicalApplicationPath: D:\Inetpub\wwwroot\CambiaWeb\Cambia3\
Request.RawUrl: /Cambia3/Temp/Test.aspx/path/info?query=arg
Request.Url.AbsolutePath: /Cambia3/Temp/Test.aspx/path/info
Request.Url.AbsoluteUri: http://localhost:96/Cambia3/Temp/Test.aspx/path/info?query=arg
Request.Url.Fragment:
Request.Url.Host: localhost
Request.Url.LocalPath: /Cambia3/Temp/Test.aspx/path/info
Request.Url.PathAndQuery: /Cambia3/Temp/Test.aspx/path/info?query=arg
Request.Url.Port: 96
Request.Url.Query: ?query=arg
Request.Url.Scheme: http
Request.Url.Segments: /Cambia3/Temp/Test.aspx/path/info

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s