How do I get the host domain name in ASP .NET without using HttpContext.Current.Request?

后端 未结 3 942
予麋鹿
予麋鹿 2021-01-18 10:56

I\'ve got an ASP .Net application running on IIS7. I\'m using the current url that the site is running under to set some static properties on a class in my application. To d

3条回答
  •  醉话见心
    2021-01-18 11:41

    Use global.asax or write a HttpModule and subscribe to start request events. You will have the request passed into your event handler.

提交回复
热议问题