Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Below Sample code is to provide anonymous access to Custom files deployed under _layouts folder
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace Help.Layouts.Feature
{
public partial class Help : UnsecuredLayoutsPageBase
{
protected void Page_Load(object sender, EventArgs e)
{
string pagesource;
pagesource = Request.QueryString["q"].ToString();
Response.Write(pagesource);
Response.Write("<object id=\"embeddedhtml\" type=\"text/html\" data=\"https://servername/sample.txt\" width=\"100%\" height=\"100%\"></object>");
}
protected override bool AllowAnonymousAccess { get { return true; } }
}
}
Happy coding ......Cheers .. Ajith