0

I have a simple SharePoint CSOM page that is used to pull the Current user and their Email. I'm hosting this page in a dedicated Site Collection which seems like overkill. It's essentially a redirect page and I'd like to host this page without the need for a Front End. ie, no Master Page or CSS or necessary javaScript loads.

Can CSOM code be hosted in, say, a HTML page if it's on the Server and loads sp.js? How could I run this code in the most minimalist way possible?

0

1 Answer 1

0

Here are two minimalist ways to run code in SharePoint:

  1. Create an ASP.NET web application and put your code in Default.aspx.cs. Deploy manually to the 15 Hive in a _layouts subfolder. Then access in the browser via http://any_site_collection/_layouts/15/subfolder/Default.aspx

  2. Rewrite your code and use JavaScript only. To host it in SharePoint, a simple and efficient way is to put the code in an HTML file in Style Library and use Content Editor web part with link to the HTML file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.