Click here to Skip to main content
15,885,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I had developed one normal website. My client has installed SSL certificate on his web hosting server (control panel).

Now he wants login page as secure page (https should appear on address bar).

My question how can i use ssl certificate and how can i make normal sign.aspx page as secure page. what code we have to write so that on accessing "https://www.xyzwebsitename.com/sign.aspx"using SSL certificate from control panel

Please provide me any hint or guidline.

Thanks in Advance.
Posted
Updated 10-Jun-11 21:06pm
v3

Start here[^]. This thread also contains a link back to an excellent article on Code Project: Switching Between HTTP and HTTPS Automatically: Version 2[^]
 
Share this answer
 
Comments
thatraja 11-Jun-11 7:32am    
Good answer dude, 5!
Uday P.Singh 11-Jun-11 11:50am    
good one, my 5
Prasanta_Prince 11-Jun-11 14:03pm    
Good one.
RaviRanjanKr 11-Jun-11 15:20pm    
Nice Link, My 5 :)
Hi,
If you need to secure only one page most simplest solution is in Global.asax
C#
protected void Application_BeginRequest(Object sender, EventArgs e)
 {
         if ( !Request.IsSecureConnection)
         {
     if(Request.Url.AbsoluteUri.contains("sign.aspx")
             {
                 string path = string.Format("https{0}", Request.Url.AbsoluteUri.Substring(4));
                 Response.Redirect(path);
             }
         }
 }

For better solution check this[^]orhere[^]
Hope this will help.
 
Share this answer
 
Comments
Uday P.Singh 11-Jun-11 11:50am    
good one, my 5
Prasanta_Prince 11-Jun-11 14:03pm    
Good one ..
RaviRanjanKr 11-Jun-11 15:20pm    
Good Answer, My 5 :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900