Get Page Path Details and URL

if we have URL Like :
http://localhost:96/Cambia3/Temp/Test.aspx?q=item#fragment to get App Path:

    Request.ApplicationPath
    result :  Cambia3
to get App Path with page name:

    Request.CurrentExecutionFilePath
    result :  Cambia3/Temp/Test.aspx
to get page path:

    Request.FilePath
    result :  Cambia3/Temp/Test.aspx
to get path:

    Request.Path
    result :  Cambia3/Temp/Test.aspx
to get local page path:

    Request.Url.LocalPath
    result :  Cambia3/Temp/Test.aspx
to get absolute path:

    Request.Url.AbsolutePath
    result :  Cambia3/Temp/Test.aspx
to get physical path:

    Request.PhysicalApplicationPath
    result :  D:\Inetpub\wwwroot\CambiaWeb\Cambia3
to get page with query:

    Request.RawUrl
    result :  Cambia3/Temp/Test.aspx?query=arg
to get url with query:

    Request.Url.PathAndQuery
    result :  Cambia3/Temp/Test.aspx?query=arg
to get url:

    Request.Url.AbsoluteUri
    result :  http://localhost:96/Cambia3/Temp/Test.aspx?query=arg
to get host:

    Request.Url.Host
    result :  localhost
to get full host:

    Request.Url.Authority
    result :  localhost:96
to get full host:

    Request.Url.Authority
    result :  localhost:96
to get port:

    Request.Url.Port
    result :  96
to get query string:

    Request.Url.Query
    result :  ?query=arg
to get schema :

    Request.Url.Scheme
    result :  http

Comments

Popular posts from this blog

C# Crop white space from around the image

Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=xx.0.0.0, Culture=neutral, PublicKeyToken='xxx' or one of its dependencies.

The specified version string contains wildcards, which are not compatible with determinism.