Objectives
WebNavPane enhances its feature to allow user to create NavBar and NavBarItem from client side.
This tutorial will guide you on how to perform the above scenario.
Following are the steps to create NavBar and NavBarItem:
- Drag WebNavPane and HTML button controls from Toolbox to the WebForm.

- Switch to Source code to create a javascript function called Create_ClientSide(). The code will look like following:
Script
Copy Code<script type="text/javascript"> function Create_ClientSide() { var nav = ISGetObject("WebNavPane1"); var navbar = new WebNavBar(); navbar.Text = "test"; navbar.Name = "test"; nav.AddBar(navbar); var item = new WebNavBarItem(); item.Text = "1"; item.Name = "1"; navbar.AddBarItem(item); navbar.Click(); } </script>
- In HTML button, you need to invoke function Create_ClientSide() using onclick event.
<input type="button" onclick="Create_ClientSide()" value="Click to create NavBar from client side" />
- Compile and run the sample. When you click the button, it will automatically add the NavBar along with its NavBarItem.
