Site Map  I got chance to knock up another part, sorry no source code this time, but you might like the idea.

Using the idea from Amazon, ebuyer and MS of the SiteMap at the top of the page I thought I could do the same with my DynamicPanel.  So I created a Webcontrol (not a webpart!) that Spat out a PopperLink (see Ajax and Sharepoint) using the CreateLink method that called yet another httpHandler.

The handler iterates thru the Areas (like this)

Guid homeGUID = AreaManager.GetSystemAreaGuid(PortalContext.Current, SystemArea.Home);

Area homeArea = AreaManager.GetArea(PortalContext.Current, homeGUID);

foreach(Area area in homeArea.Areas)
textWriter.WriteLine (“<TD valign=’top’><TABLE><TR><TD valign=’top’><b><A href='” + area.WebUrl +”‘>” + area.Title + “</a><b></TD></TR>” + RecurseArea(area) + “</TABLE></TD>”);

private string RecurseArea(Area area)
string s=””
foreach(Area areaChild in area.Areas)
s+= (“<TR><TD valign=’top’><A href='” + areaChild.WebUrl +”‘>” + areaChild.Title + “</a></TD></TR>”);

return s;

Simple Stuff (obviously I have surrounding tables too).

This produces a clickable partial page of links.  The HttpHandler is called by the popper and on clicking the Site Map link (see later) it Ajax calls the handler and puts the resultant html in the popup window.

Then using the techniques here Applying a Custom Banner I placed the control on the page in the new custom banner.

Hey presto Fancy Ajax dynamically populated Sharepoint 2003 Site Map.

Technorati tags: , , , ,