Sunday, May 20, 2012

Redirection of page from http to https using VB.net and C#

Redirection of page from http to https using VB.net

If Not Request.IsSecureConnection Then
 Dim redirectUrl As String = Request.Url.ToString().Replace("http:", "https:")
 Response.Redirect(redirectUrl)
End If

Redirection of page from http to https using C#
if(!Request.IsSecureConnection)
{
  string redirectUrl = Request.Url.ToString().Replace("http:", "https:");
  Response.Redirect(redirectUrl);
}

No comments:

Post a Comment