Showing posts with label HttpContext.Request. Show all posts
Showing posts with label HttpContext.Request. Show all posts

Thursday, 22 August 2013

How to check the protocol of web page is HTTP or HTTPS


Inside .aspx.cs:

Request.IsSecureConnection


Outside .aspx.cs means in custom class:

HttpContext.Current.Request.IsSecureConnection

How to Verify the website is secured HTTPS using asp.net

Inside .aspx.cs:

Request.IsSecureConnection

Outside .aspx.cs means in custom class:

HttpContext.Current.Request.IsSecureConnection

How to get the current logged-in user name using asp.net


Code Snippet:

System.Web.HttpContext.Current.User.Identity.Name()