Keep in touch

you can keep in touch with my all blogs and sites by install this Toolbar...
http://rworldtoolbar.ourtoolbar.com/

Saturday, March 6, 2010

ASP.NET: Force Page to Use secure connection HTTPS

Sometimes we want to provide secure channel over an insecure network. e.g. for payment transactions. In that case we need HTTPS connection

Assume that your page is as follows: http://www.mydomain.com/mypage.aspx

Just add following code inside Load Event Handler!

If Not Request.IsSecureConnection Then
Response.Redirect("https://www.mydomain.com/mypage.aspx ")
End If

No comments: