Optionally provide private feedback to help us improve this article...

Thank you for your feedback!


Creating a sitemap from your forums

New

You can use the InstantForum .NET API to easily create a site map representing all your InstantForum forums. The following code demonstrates how to do this from your own ASP.NET web site.

Add the necessary using statements

You'll first need to reference the InstantForum assemblies from your own Visual Studio solution.

using InstantASP.InstantForum;
using InstantASP.InstantForum.UI;
using InstantASP.InstantForum.Enumerations;
You can then use the following helper method within the InstantASP.InstantForum.UI namespace to create a structured view of your forums...

// get formatted collection of forums
var forums = new Helpers.FormattedForumCollection(
null,
HttpContext.ForumContext.Current.CurrentUser,
HttpContext.ForumContext.Current.CurrentCulture,
EnumForumDropDownValueType.ForumJump, 
false,
true,
true,
true);


foreach (System.Web.UI.WebControls.ListItem item in forums.ListItemCollection())
{
var link = string.Format("<a href=\"{0}\" style=\"text-decoration: none;\">{1}</a>", item.Value, item.Text);
Response.Write(link + "<br/>");


}

Response.End();

This will produce the following output...

That's It!

We hope this simple example helps. If you would like to see any further examples or require any assistance using the InstantForum .NET API of course please never hesitate to contact us or submit a support request.