Anonymous Access: SharePoint 2013 Custom Application Page

Step 1: Open the Central Admin and go to Manage Web Application (under Application Management) .

Step 2: Choose the Web Application you want anonymous access for and click on Authentication Provider .

Web Application

Click Default, 

Default

Step 3: Check Anonymous Access and Click OK.

Access
Step 4: Open Visual Studio, create New Sharepoint Project, and add Application Page in it .

Step 5: Now remove DynamicMasterPageFile="~masterurl/default.master" from aspx page .

page

Step 6: Change the Code in aspx.cs to UnsecuredLayoutsPageBase as below,

  1. public partial class PageName: UnsecuredLayoutsPageBase  
  2. {  
  3.         protected override bool AllowAnonymousAccess   
  4.         {  
  5.             get   
  6.             {  
  7.                 return true;  
  8.             }  
  9.         }  
code

Step 7: Open the Page in Browser (No Login Pop-up will come).

Page