Wednesday, December 7, 2022

How to get host address URL (localhost) in asp.net C# - How to get website URL or address

 System.Net.Dns.GetHostAddresses


Request.Url.OriginalString:- gives the full url ("http://localhost:40521/CourtApplicationInitialDetails.aspx?ApplicationId=849D7BC4F5522ABF6EB83D12C1D8F6F0&ViewMode=50BC43FFB2CECA8F54315A8CC69D3B80")


Request.Url.Authority: It gives "localhost:40521" with port name


Request.Url.Host :- It give only localhost or www.google.com


Request.Url.LocalPath :- It does not give full URL path , only give    (/CourtApplicationInitialDetails.aspx)


Request.Url.Query:- this will only gives:-

 ?ApplicationId=849D7BC4F5522ABF6EB83D12C1D8F6F0&ViewMode=50BC43FFB2CECA8F54315A8CC69D3B80

No comments:

Post a Comment