c# - Getting URL without port when running from VS, or without application name when running in IIS -
my application's url looks when run debugger
http://localhost:52230/ and in iis:
http://localhost/myapp or, when i'm browsing pc,
http://192.168.168.11/myapp where myapp = application's name.
is there way, using razor syntax, http://localhost or http://192.168.168.11 only?
i tried @url.content("~/) returns me http://localhost:52230/
try
@(context.request.url.scheme + "://" + context.request.url.dnssafehost)
Comments
Post a Comment