none
ASP.net C# and IIS7 Request.IsSecureConnection Problem

    Question

  • Hi

    I am setting SSL on my website and it seems that the Request.Request.IsSecureConnection variable doesn't pickup that the page is secure even though the page is being viewed through HTTPS.

    When i view the page internally which just runs this segment of code on load:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data.SqlClient;
    
    public partial class OnlineServices_test : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
    
    
            label1.Text = Request.IsSecureConnection.ToString();
    
    
            
         
        }
    }

    When view internally (https://localhost/test.aspx) the page shows true, however when the same file is viewed externally (https://<<WebsiteURL>>/test.aspx it shows as false.

    Any help or suggestions would be greatly appreciated.

    Tuesday, June 26, 2012 1:52 PM

Answers