As documentation link https://docs.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.webpartpages.xsltlistviewwebpart?view=sharepoint-server

I added the Microsoft.SharePoint.WebPartPages reference for XsltViwerWebPart in SharePoint 2016 solution.

However, I get a reference error for XsltViwerWebPart

What's the correct namespace?

How can I use XsltViewerWebPart in SP 2016?


You need add Microsoft.SharePoint.dll into References in visual studio solution.

And then add the code below to .cs file.

using Microsoft.SharePoint.WebPartPages;

If you want to use XsltListViewWebPart, the following example for your reference.

Programmatically Adding XsltListViewWebPart Inside Panel in SharePoint

| improve this answer | |
  • Thanks for your input, I added microsoft.sharepoint reference, still can't find it at SP solution 2016 – Arul kumar Sep 6 '18 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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