kIRANSREDDY

How can we access SharePoint site list/documents using WSS objects from a regular asp.Net website which is hosted on the same box as the SharePoint website
Note: we do not want to use webservices.
Problem we have:- we can only access those site lists/documents if we make the website Authentication mode as windows and turn off Anonymous on the site. Is there a way round where we can access it directly by passing the user credentials


Re: SharePoint - Development and Programming Accessing sharepoint lists from a asp.net website

Gaurav Rehan

As you said that the ASP.NET site is hosted on the same box as the SP Site, you can reference Microsoft.SharePoint.dll directly in the ASP.NET App.
After adding the reference, access SP Site is simple

SPSite spCollection = new SPSite("http://serverStick out tongueort/sitecollection");
SPWeb spWeb = spCollection.RootWeb;

SPListCollection coll = spWeb.Lists;

foreach(SPList list in coll)
{
//do the stuff
}





Re: SharePoint - Development and Programming Accessing sharepoint lists from a asp.net website

grimstone45

have you tried running your app from the _layout folder.