Friday, 21 February 2014

http to https redirect in asp.net

write code on page load event

if(!Request.IsSecureConnection)
{
string redirectUrl = Request.Url.ToString().Replace("http:", "https:");
Response.Redirect(redirectUrl);
}

No comments:

Post a Comment