lundi 12 janvier 2015

how to get the instance ID and get the documents from that instance?



I'm using (SP2010) Meeting Workspace - using a list and a document library. So Every meeting has it's own documents and lists. I've created a button in CreatChild Controls and associated the getDocuments function to the Button. The strange thing is I don't get the documents from that instance. Even if I switch to other instance it gives always the same documents.


I go over the List and Document library to get my documents in web part.


so how can I specify the instance ID and get the 'documents' and the 'lists' from that specific instance? Now I get all documents/lists from the same instance always?


The strange thing is, I'm in that instance


I'm using a WEB PART - Sandbox solution. see below the sample code how I get my documents and lists in C#?



string strUrl = "http://sharepoint/mysite/Meeting/";
using (SPSite oSite = new SPSite(strUrl))
{
using (SPWeb oWeb = oSite.OpenWeb())
{
SPDocumentLibrary oLib = (SPDocumentLibrary)oWeb.Lists["Document Library"];
}
}







0 commentaires:

Enregistrer un commentaire