UltimateSitemap Server-Side API

UltimateSitemap is a custom control for ASP.NET to generate a sitemap of your web application in a table or tree format. You can drag and drop the control like any other web control (server control) onto your Web page in VS.NET, and provide a source for it. You have four options to set the source of your sitemap.

1. Set SitemapSource to an XML file at design-time or run-time: You can create an XML file either by using UltimateSitemapDesigner as your visual designer tool, or by manually authoring the file with the help of IntelliSense.

2. Set SitemapSourceXml to an XML string at run-time: You can create your sitemap XML string programmatically by using XMLDocument object model. Sample code is provided with download.

3. Set DatabaseConnStr and DatabaseSitemapID at design-time or run-time: You can create a data source (in SQL server, Access or any other database by providing the connection string) either by using UltimateSitemapDesigner , or by manually filling the UltimateSitemap table in your database.

4. Set DataSource to a dataset at run-time: You can create a dataset from your data source easily by using ADO.NET. Sample code is provided with download.
All public properties except SitemapSourceXml and DataSource can be changed at design-time or run-time. SitemapSourceXml and DataSource can be changed at run-time only.

SitemapSourceXml XML string to load the UltimateSitemap control from (run-time only).
DataSource Dataset to load the UltimateSitemap control from (run-time only).


Your sitemap will be automatically located at the position where you place the UltimateSitemap control on your web page. If you put the control into a table cell it will be positioned relatively. Therefore you can achieve both relative and absolute positioning by just dragging and dropping the control inside or outside a table.

Sitemap XML file has a simple hierarchy of siteMapNode elements. You can find the XML schema in UltimateSitemapSource.xsd. You can find the siteMapNode attributes in UltimateSitemapDesigner.

Here is the list of public properties that can be changed at design-time or run-time:
Sitemap Display
CurrentUser Current user logged into the system will only see the allowed items specified by the allowedUsers property of an item. If CurrentUser is not specified all items will be displayed. If it is set to a value then AllowedUsers property of each item will be checked. If AllowedUsers is not specified for an item it will be displayed. Otherwise it needs to include the CurrentUser in its comma separated list of users.
CurrentUserSessionVar Session variable that holds the current user logged into the system. If you set this property to the session variable name that keeps the username the sitemap control will automatically retrieve the value of that session variable and set it to the CurrentUser property.
DisplayType Display type can be either Table or Tree. Default is Table.
Sitemap Display Table
ColumnCount Number of columns in the table. Default is 3.
ColumnsPerRow Comma delimited list of number of columns per each row for FixedRows_VariableColumns. Default is 3,3.
RowCount Number of rows in the table. Default is 2.
RowsPerColumn Comma delimited list of number of rows per each column for FixedColumns_VariableRows. Default is 2,2,2.
TableAutoFillType Method to fill table cells automatically when TableFillType is AutoFill, which may be set to RowWise or ColumnWise. Default is RowWise.
TableFillType Method to fill table cells, which may be set to AutoFill or ManualFill. Default is AutoFill.
TableFormat Format of the table, which may be set to FixedRows_FixedColumns, FixedRows_VariableColumns or FixedColumns_VariableRows. Default is FixedRows_FixedColumns.
Sitemap Display Tree
TreeDisabled Boolean to disable the tree expand/collapse features. Default is True since default DisplayType is Table.
TreeExpandAll Boolean to expand all tree nodes. Default is True. If it is set to False all tree nodes get collapsed.
TreeFolderClosedImage Default left icon for closed parent nodes. Default is ~/Images/KSTF/fc.gif. It can be overriden by the folderClosedImage attribute of the node in XML. Note that you may need to copy or point to the KSTF image directory under C:\inetpub\wwwroot\Karamasoft\ASP.NET2.0\UltimateSitemap\v2.2\Controls\Images if you used the tree folder images to display your sitemap.
TreeFolderDisplay Method to display left icons for parent and leaf nodes, which may be set to ShowNoImages, ShowFolderOnly, ShowLeafOnly or ShowFolderAndLeaf. Default is ShowNoImages since default DisplayType is Table.
TreeFolderLeafImage Default left icon for leaf nodes. Default is ~/Images/KSTF/fl.gif. It can be overriden by the folderClosedImage attribute of the node in XML. Note that you may need to copy or point to the KSTF image directory under C:\inetpub\wwwroot\Karamasoft\ASP.NET2.0\UltimateSitemap\v2.2\Controls\Images if you used the tree leaf images to display your sitemap.
TreeFolderOpenImage Default left icon for open parent nodes. Default is ~/Images/KSTF/fo.gif. It can be overriden by the folderOpenImage attribute of the node in XML. Note that you may need to copy or point to the KSTF image directory under C:\inetpub\wwwroot\Karamasoft\ASP.NET2.0\UltimateSitemap\v2.2\Controls\Images if you used the tree folder images to display your sitemap.
TreeImageCssClass Default CSS class for the tree images. Default is KSTI.
TreeJunctionDisplay Method to display junction images for tree nodes, which may be set to ShowNoImages, ShowPlusMinusOnly or ShowPlusMinusWithLines. Default is ShowNoImages since default DisplayType is Table.
TreeJunctionImagePath Path for the tree junction images. Default is ~/Images/KSTJ. Note that you may need to copy or point to the KSTJ image directories under C:\inetpub\wwwroot\Karamasoft\ASP.NET2.0\UltimateSitemap\v2.2\Controls\Images if you used the tree junction images to display your sitemap.
Sitemap Selection
ChildLevelsDisplayed Number of child levels displayed as a subset of the tree starting with the level selected by StartingNodeID, StartingNodeURL or StartingDepth in this order. Default is -1, which stands for all levels.
StartingDepth Depth to start the child selection process for a subset of the tree. Default is 0, which stands for the root level. StartingNodeID and StartingNodeURL override this property.
StartingNodeID ID of the node to start the child selection process for a subset of the tree. Default is 0, which stands for the root level.
StartingNodeUrl URL of the node to start the child selection process for a subset of the tree. StartingNodeID overrides this property.
Sitemap Source
DatabaseConnStr Database connection string to save/load the sitemap to/from database.
DatabaseSitemapID ID of the sitemap in the UltimateSitemap table in the database.
SitemapSource Source XML file.
Sitemap Style
ChildNodeCssClass Default CSS class for the child nodes of the tree. Default is KSCN. It can be overriden by the childNodeCssClass attribute of the node in XML.
LeafNodeCssClass Default CSS class for the leaf nodes of the tree. Default is KSLN. It can be overriden by the nodeCssClass attribute of the node in XML.
ParentNodeCssClass Default CSS class for the parent nodes of the tree. Default is KSPN. It can be overriden by the nodeCssClass attribute of the node in XML.
Sitemap Table Cell Style
TableCellCssClass Default CSS class for all table cells.
TableCellCssClassOverride Comma delimited list of CSS classes for table cells in the form of (colIndex,rowIndex,cssClass) to override the default TableCellCssClass.
TableCellHeight Height of each table cell when TableFormat is FixedRows_FixedColumns. Height of each table row when TableFormat is FixedRows_VariableColumns. This property is not used when TableFormat is FixedColumns_VariableRows.
TableCellHorizontalAlign Horizontal alignment of each table cell, which may be set to Left, Center or Right. Default is Left.
TableCellVerticalAlign Vertical alignment of each table cell, which may be set to Top, Middle or Bottom. Default is Top.
TableCellWidth Width of each table cell when TableFormat is FixedRows_FixedColumns. Width of each table column when TableFormat is FixedColumns_VariableRows. This property is not used when TableFormat is FixedRows_VariableColumns.
Sitemap Table Separator   See Image
HorizontalSeparatorColor Color of horizontal separators between table rows. Default is #CECECE.
HorizontalSeparatorHeight Height of horizontal separators between table rows. Default is 1.
HorizontalSeparatorSpacing Spacing between horizontal separators. Default is 0.
SeparatorSpacingColor Color of the spacing around the separators. Default is #FFFFFF.
VerticalSeparatorColor Color of vertical separators between table columns. Default is #CECECE.
VerticalSeparatorSpacing Spacing between vertical separators. Default is 0.
VerticalSeparatorWidth Width of vertical separators between table columns. Default is 1.
Sitemap Table Style
TableBorder Border width of the table. Default is 0.
TableBorderColor Border color of the table. Default is #000000.
TableBorderColorDark Dark border color of the table to give an impression of a light source. This property overrides BorderColor in IE. Default is #808080.
TableBorderColorLight Light border color of the table to give an impression of a light source. This property overrides BorderColor in IE. Default is #D4D0C8.
TableCellPadding Padding inside each table cell. Default is 0.
TableCellSpacing Spacing between table cells. Default is 0.
TableHeight Height of the table.
TableHorizontalAlign Horizontal alignment of the table, which may be set to Left, Center or Right. Default is Left.
TableWidth Width of the table.