Thursday 22 August 2013

Different types of Caching in ASP.NET



ASP.NET supports three types of caching for Web-based applications:

  1. Page Level Caching (called Output Caching)
  2. Page Fragment Caching (often called Partial-Page Output Caching)
  3. Programmatic or Data Caching

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()