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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can refer to the
Request.IsSecureConnectionproperty on theHttpRequestclass. For a full reference outside a page, user control or alike, useHttpContext.Current.Request.IsSecureConnection.