Blog

SharePoint Provider-Hosted Add-In: Use the website to access the list of a host web

Next challenge is to call a full page without the look and feel of a SharePoint one and without making use of SharePoint. It means, the user goes directly to the website and gets the information from SharePoint. Visual Studio prepares the site with the code.

This code with client context won’t work for this requirement. It will get an error message: “System.NullReferenceException: Object reference not set to an instance of an object.”

As a solution, you should use this code with the class TokenHelper.cs.

That’s cool. The code will verify if the add-in and user have permission on this site like host web. I use it with the scope of the web, and the permission is ‘read’.

Now you can work with this. Here is an example of what I did.

Here is the result, check also URL with Parameter: