If somebody like the post and its helpful in your work then, add comments.

Sunday, November 30, 2008

Get Subsite List

public void GetListItemS()
{
SPSite rootSite = new SPSite("http://mossvs2008");
SPWeb subSIte = rootSite.OpenWeb();
SPWebCollection SPWebCol = rootSite.AllWebs;
for (int i = 0; i < SPWebCol.Count; i++)
{
string titlestr = SPWebCol[i].Title;
Response.Write(titlestr);
if (titlestr == "VESample")
{
SPListCollection SPListCol = SPWebCol[i].Lists;
foreach (SPList SPSubList in SPListCol)
{
if (SPSubList.ToString() == "SampleList")
{
Response.Write(SPSubList.ToString());
}
}
}
}
}

No comments:

Post a Comment