Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

A good day with WSS

  Asked By: Willis    Date: Nov 11    Category: Sharepoint    Views: 1237

Just thought I'd say I had a good day with writing web parts for WSS.



5 Answers Found

Answer #1    Answered By: Arron Middleton     Answered On: Nov 11

So what kind a parts  did you write?

Answer #2    Answered By: Vance Hardin     Answered On: Nov 11

One that showed all the subsites to a WSS site for the user and providing links to the site.

Answer #3    Answered By: Kareem Flynn     Answered On: Nov 11

Would you be open to sharing the code with the group. Any code that accesses the SOM is always helpful.

Answer #4    Answered By: Tyron Calderon     Answered On: Nov 11

You can also get the book "Building Sharepoint Web
Parts" by Darrin Bishop (Rational Press) which has
that type of project step by step... approx $15us.
Covers Portal Server and WSS. ISBN 0972688862


Answer #5    Answered By: Irvin Foley     Answered On: Nov 11

Try this link for tree view result

otherwise getting all the wss  sites and their subsites can be easily done by calling a function recursively. See the example below.

public class Acer.WebPart.SiteNav : Microsoft.SharePoint.WebPartPages.WebPart
string treeView = "";

protected override void RenderWebPart(HtmlTextWriter output)
SPSite site = SPControl.GetContextSite(Context);
SPWeb web  = site.OpenWeb();
SPWebCollection webCol = web.Webs;

treeView += "<ol>";
treeView += "</ol>";

private void RecursiveWeb(SPWebCollection webCol)
foreach(SPWeb web in webCol)
treeView += "<li><a href='"+ web.Url + "'>" + web.Title + "</a>";
treeView += "</li>";

private void RecursiveWeb2(SPWebCollection webCol)
if(webCol.Count != 0)
treeView += "<ol>";
treeView += "</ol>";

In the tool pane you can also set the property to make the site links open in the same window or new window. This output will be something like this if you have subsites in http://acer/sites/Site1/default.aspx

1. Site1a
1. Site1a1
1. Site1a1a
1. Site1a1a1a
2. Site2a1
2. Site1b
3. Site1c

We can also do this in many other ways.

Didn't find what you were looking for? Find more on A good day with WSS Or get search suggestion and latest updates.