I have a web application hosted on multiple servers some of which are on https. How can I check from code behind if a page is currently in http or https?
+10
A:
You can refer to the Request.IsSecureConnection
property on the HttpRequest
class. For a full reference outside a page, user control or alike, use HttpContext.Current.Request.IsSecureConnection
.
troethom
2009-08-31 08:17:09
29 seconds... ;-)
Rashack
2009-08-31 08:18:02