Anonymous User access to SharePoint application page.

In SharePoint 2013, when you develop application pages for anonymous user - user who is not a part of SharePoint group.
 
There are two things that you should keep in mind.
 
1. Application page(.aspx) should inherit UnsecuredLayoutsPageBase.
 
2. You need to override the AllowAnonymousAccess property and return true see the following code

 

protected override bool AllowAnonymousAccess
 {
  get
{
   return true; 
  } 
}