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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With