Configuring the Karamasoft UltimateSitemap control for ASP.NET allows you to generate dynamic, SEO-friendly XML sitemaps and visual navigation elements for your web applications. UltimateSitemap integrates into the ASP.NET provider model, making it highly customizable for both static pages and dynamic database-driven URLs.
Here is a step-by-step guide to installing, configuring, and deploying Karamasoft UltimateSitemap in your ASP.NET project. Prerequisites and Installation
Before configuring the control, you must add the necessary binaries to your project.
Add the DLL Reference: Copy the Karamasoft.WebControls.UltimateSitemap.dll file into your application’s Bin folder, or right-click References in Visual Studio and select Add Reference to browse to the file.
Register the Control: Add the registration directive to the top of your ASP.NET page (.aspx) or Master Page, or register it globally in your web.config file. To register it globally in web.config:
Use code with caution. Step 1: Configure the Web.Config File
UltimateSitemap utilizes the ASP.NET SiteMapProvider architecture. You need to define the provider within the section of your web.config file.
Use code with caution.
siteMapFile: Specifies the XML file containing your physical structure.
securityTrimmingEnabled: Set to true if you want to hide sitemap nodes based on ASP.NET Roles and authorization rules. Step 2: Create the Web.sitemap File
Create a standard physical XML sitemap file named Web.sitemap in the root directory of your application. This file maps the static structure of your website.
<?xml version=“1.0” encoding=“utf-8” ?> Use code with caution. Step 3: Add the UltimateSitemap Control to the Page
Place the visual control on your page or your layout’s Master Page. You can style the control inline or link it to a CSS stylesheet.
Use code with caution. Step 4: Dynamically Populating Nodes via Code-Behind
For large or e-commerce applications, you cannot hardcode every URL into an XML file. UltimateSitemap allows you to hook into data sources like SQL databases to append dynamic nodes (e.g., product details pages) at runtime.
In your Page_Load event or within a custom provider class, you can manipulate nodes programmatically:
using System; using System.Web; using Karamasoft.WebControls; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Fetch the root node or a specific parent node SiteMapNode productsNode = SiteMap.Provider.FindSiteMapNode(”/Products.aspx”); if (productsNode != null) { // Example data loop (replace with your database call) for (int i = 1; i <= 3; i++) { string dynamicUrl = $”/Products/Details.aspx?id={i}“; string dynamicTitle = $“Product item #{i}”; // Create a new node using the Karamasoft framework SiteMapNode dynamicNode = new SiteMapNode(SiteMap.Provider, dynamicUrl, dynamicUrl, dynamicTitle); // Attach the dynamic node to the static parent node productsNode.ChildNodes.Add(dynamicNode); } } } } Use code with caution. Step 5: Generating search engine compatible XML Sitemaps
UltimateSitemap includes built-in engines to output pure XML format sitemaps for Google, Bing, and Yahoo search crawlers. To generate an engine-readable schema, create a blank page named sitemap.aspx and strip out all HTML content, leaving only the page directive.
In the code-behind of sitemap.aspx.cs, render the sitemap directly into the HTTP response stream:
protected void Page_Load(object sender, EventArgs e) { Response.ContentType = “text/xml”; Response.ContentEncoding = System.Text.Encoding.UTF8; // Clear output to prevent accidental whitespaces Response.Clear(); // Call the UltimateSitemap export engine to write directly to the stream UltimateSitemap1.WriteSearchEngineSitemap(Response.OutputStream); Response.End(); } Use code with caution. Conclusion
Karamasoft UltimateSitemap simplifies complex navigation management in ASP.NET. By combining a core Web.config declaration, a base static Web.sitemap hierarchy, and runtime C# additions, you establish a structure capable of driving both your on-screen UI links and your automated search engine discovery files. If you want to tailor this implementation, tell me:
Are you using ASP.NET Web Forms or an older MVC legacy architecture?
What database engine (SQL Server, MySQL, etc.) holds your dynamic URLs?
Do you need to set up SEO metadata parameters like and tags?
I can provide the exact code or configuration blocks required for your setup.