an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 9/30/2010 2:41:12 PM By Bahram. 4 replies.
9/28/2010 9:34:41 AM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
SSL on a aspx form
 Hi Luke,
 
I have aspx form for validating logged users, How I securing it under SSL
 
Thanks,
9/28/2010 9:28:32 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: SSL on a aspx form
If the page is define din Module.conifg, use isSecure attribute.
 
<add name="Register" blockTypeId="22" isSecure="true" />
 
Otherwise you can set base.IsSecure in the page constructor.
 
public partial class MyPage : DSCPage {
    public MyPage() {
        base.IsSecure = true;
    }
 
DotShoppingCart Staff
9/30/2010 12:10:14 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: SSL on a aspx form
The page is in-house and not a DSC one, so no blockTypeId it has. Should I go with the second method?
 
9/30/2010 12:21:06 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: SSL on a aspx form
You can just put code to check if it's https. If not, redirect to itself with https on.
DotShoppingCart Staff
9/30/2010 2:41:12 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: SSL on a aspx form
 Yes I did found the code and I transformed it in C# :
 
          if ( Request.ServerVariables["SERVER_PORT"] == "80" )
             {
               string strSecureURL = "https://";
               strSecureURL = strSecureURL + Request.ServerVariables["SERVER_NAME"];
               strSecureURL = strSecureURL + Request.ServerVariables["URL"];
               Response.Redirect( strSecureURL);
            }