I assume that by saying
pages what we created using Visual Studio
you mean application pages created in Visual Studio and deployed to _layouts directory. If you want to make such page anonymous, you have to change base class in your code behind. By default, application pages inherit from LayoutsPageBase
class, and you have to change it to UnsecuredLayoutsPageBase
and you have to override property AllowAnonymousAccess
to return true:
public partial class ApplicationPage1 : UnsecuredLayoutsPageBase
{
protected override bool AllowAnonymousAccess
{
get
{
return true;
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
Of course your web application also must have anonymous access enabled.
Creating a SharePoint Application Page for Anonymous Access