In ASP.NET There are two way of doing it. Either we can use current request to check whether it is secured or not or we can use server variables to check whether it it secure or not just like following.
HttpContext.Current.Request.IsSecureConnectionHere in above code If this returns true then Page is secured otherwise it is not Or you can use following server variable to check the protocol.
document.location.protocol=='https:'So you can see its very easy to check whether page is secure or not. Hope you liked it… Stay tuned for more..