using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

 

namespace Security

{

    public partial class SSLSecurityDemo : System.Web.UI.Page

    {

        protected void Page_Load(object sender, EventArgs e)

        {

            if (Request.IsSecureConnection)

                lblDisplay.Text = "Secure SSL Connection";

            else

                lblDisplay.Text = "This page is not using a secure SSL connection";

 

        }

        protected void btnSecure_Click(object sender, EventArgs e)

        {

            // Change the protocol in the URL string from HTTP to HTTPS

            // and redirect to the new URL to setup a secure SSL connection

            String url = Request.Url.ToString().Replace("http:", "https:");

            Response.Redirect(url);

        }

 

        protected void btnNoSecurity_Click(object sender, EventArgs e)

        {

            Response.Redirect("http://cis-iis2.temple.edu/Users/Pascucci/CIS3342/SecurityDemo.aspx");

        }

 

        protected void btnSecurityTransfer_Click(object sender, EventArgs e)

        {

            Response.Redirect("https://cis-iis2.temple.edu/Users/Pascucci/CIS3342/SecurityDemo.aspx");

        }

    }

}