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:
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
Post a Comment