Hello,
I have made a user control in asp.net c#. Becuase of some data I need to retrieve I would like to get the site id that is used for this site in iis. Is this possible, and if so, how?
Thanks!
Hello,
I have made a user control in asp.net c#. Becuase of some data I need to retrieve I would like to get the site id that is used for this site in iis. Is this possible, and if so, how?
Thanks!
If it helps, one option here is to use the <location path="site-id">...</location>
in the global web.config (i.e. the one in the framework folder) to specify different configuration options for different sites, such as different app-settings, connection-strings, etc.
This will give you the site ID:
Request.ServerVariables[ "INSTANCE_ID" ]
If you just need to get it once then you can lookup the log file path in the IIS MMC. The number after the "W3SVC" part is also the site id.