ASP.net check if page is http or https
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
.
Page.Request.Url.Scheme
works as well. It returns http
, https
, etc.
Ref: http://msdn.microsoft.com/en-us/library/system.uri.scheme.aspx