开发者

Find Website Name from a web application

开发者 https://www.devze.com 2023-01-14 20:11 出处:网络
I have two web site sites on IIS 7 (Default, Custom). Both Sites host the same webapplication. Some of the web application behavior changes depending under what web site it is running. Is there a way

I have two web site sites on IIS 7 (Default, Custom). Both Sites host the same web application.

Some of the web application behavior changes depending under what web site it is running. Is there a way for the web application to find out what is the name of the WebSit开发者_JS百科e under which it is handling the current request.

Thank you Imran


System.Web.Hosting.HostingEnvironment.SiteName

will get you the site name as it appears in IIS

Request.Url.Authority

will get yo the requesting url

0

精彩评论

暂无评论...
验证码 换一张
取 消