Quantcast
Channel: MSDN Blogs
Viewing all articles
Browse latest Browse all 29128

Deploy files to _layouts folder in SharePoint 2013 and provide anonymous access

$
0
0

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=\"http://servername/sample.txt\" width=\"100%\" height=\"100%\"></object>");

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

Happy coding ......Cheers .. Ajith

 


Viewing all articles
Browse latest Browse all 29128

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>