Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Getting Site Information

  Asked By: Arthur    Date: Jul 19    Category: Sharepoint    Views: 1188

I am new to Sharepoint programming. I have a task. Assume that there is a site called http://SPoint-1kfzq:100/sites/TipOfTheDay/default.aspx

Now if I want to programmatically go to “TipOfTheDay” site how do I go. I tried the ALLWeb it’s looping through sites but not showing “TipOfTheDay” Can some one help me in this regard.

The code I have used is :

SPSite mySite = SPControl.GetContextSite(Context);

SPWebCollection sites = mySite.AllWebs;

for (int i=0;i<sites.Count;i++)


output.Write(sites[i].Title+" : ");




1 Answer Found

Answer #1    Answered By: Marshall Castro     Answered On: Jul 19

How about...

SPSite siteCollection = new SPSite(siteCollectionName);
SPWeb web = siteCollection.OpenWeb(siteName);

Didn't find what you were looking for? Find more on Getting Site Information Or get search suggestion and latest updates.