Practical-17
Sitemap Control
In this practical, we will learn how to use the Sitemap control in ASP.NET.
Step 1: Create a new ASP.NET Web Application project
- Open Visual Studio and create a new ASP.NET Web Application project.
- Choose the Empty template and click OK.
Step 2: Add a Sitemap control to the web form
- Open the default.aspx file in the Solution Explorer.
- Switch to the Design view.
- Drag and drop a Sitemap control from the Toolbox onto the web form.
Step 3: Configure the Sitemap control
- Select the Sitemap control on the web form.
- In the Properties window, set the DataSource property to the XML file containing the sitemap data.
- Set the ShowStartingNode property to true to display the starting node of the sitemap.
- Set the StartingNodeOffset property to 1 to offset the starting node by one level.
Step 4: Run the application
- Press F5 or click the Start Debugging button to run the application.
- The web form will display the sitemap hierarchy based on the XML data source.
That's it! You have successfully implemented the Sitemap control in ASP.NET.
Make sure to save your changes and submit this practical in your notebook.