Datta Kharad

Datta Kharad

  • NA
  • 1.6k
  • 52.5k

How to Implement SSL only for the login page in ASP.Net?

Dec 4 2014 9:41 AM
Hi
    I am implementing SSL for login page, but its implemented all pages. Even I unchecked 'Require SSL' in SSL Settings.
* IIS Configuration process:- 
1) Created Self-Signed Certificate.
2) Done binding process.
     
     Now after binding process it will take https for all pages. Even I didn't check 'Require SSL' in SSL Settings. I want to apply ssl (https) only for the login page not all pages.

* Also tried this code:-
Added this code on PageLoad event in login page. But its not working.
if(!HttpContext.Current.Request.IsSecureConnection)
{
Response.Redirect(Request.Url.Replace("http://","https://"),true);
return;
}
     Please tell me how to do that. Any help would be greatly appreciated.
Thanks. 

Answers (3)