Home > .net 1.1, SharePoint 2003 > sps object model for dummies…

sps object model for dummies…

June 9, 2006

Anyone out there have a list of the entire SharePoint Portal 2003 object model that is a map or something? I spent a good deal of time today trying to parse out the relative URL just to, on a whim, try it and find out it’s NAME. wtf. Title != Name, Url != Url, but Name == Url.😦

Anyway, if you want to parse out the actual web URL (heh, the more I type it, the more it make sense to call it Name, damn you Microsoft), try the following. In my example, I’m breaking them into an array to deal with later.

foreach(SPWeb web in spCurrentWeb.Webs)
webList += web.Name.ToString();
webList += "|";
// Trim off excess |
webList = webList.Substring(0,webList.Length - 1);
// Split into array
siteArray = webList.Split('|');

And yes, I’m sure I could use an IList or something… but it’s modifying an existing webpart that used an array for entry (I’m adding where they can put in a * to grab all webs), and I’m not in the mood to recode it all.

Categories: .net 1.1, SharePoint 2003
%d bloggers like this: