Domanda

Sto utilizzando VS 2010 per creare una web part SP 2010. Voglio includere le mie immagini, file CSS e JS file nel progetto VS, e li hanno essere distribuiti nella posizione corretta. La mia comprensione è che dovrei usare SPWebPartManager.GetClassResourcePath() per ottenere gli URL per questi elementi, e che i file devono finire in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\{web part name}\{version}__{pk token}.

  1. È possibile che questo corretto, o c'è un modo migliore?

  2. Come includo queste multe nel progetto VS in modo che siano distribuiti in questa posizione - per esempio Esiste uno SharePoint mappato cartella devo metterli in?

È stato utile?

Soluzione

To deploy it to the wpresources location then you add the resources to the SPI (SharePoint item) in Visual Studio. For instance righ-click on a Web Part item and then add an existing item. Select the new item and look at its properties (F4) and check the Deployment Type. It should be set to NoDeployment by default. Change it to ClassResource...tada...done!

This will add the necessary XML elements (ClassResources/ClassResource) to your package

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top