- Introduction
- Declaring a Simple Custom Control
- Extending Existing Web Controls
- Creating ViewState-Enabled Control Properties
- Creating a Composite Control
- Creating a Data-bound Control
- Creating a Templated Control
- Dynamically Adding Controls to a Web Form
- Using the Treeview IE Web Control
- Using the TabControl and PageView IE Web Controls
- Using the ToolBar IE Web Control
- Data-binding a TreeView Control
- Installing a Component in the Global Assembly Cache (GAC)
3.10. Using the ToolBar IE Web Control
You want to implement a toolbar using the ToolBar IE Web Control.
Technique
The first step is to install the IE Web Controls from Microsoft.
The link to download and install these controls is as follows: http://msdn.microsoft.com/downloads/samples/ internet/default.asp?url=/downloads/samples/internet/asp_dot_net_ servercontrols/webcontrols/default.asp
Next, you need to add a reference to the Web Controls on your page:
<%@ Register TagPrefix="ieControls" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> <%@ import namespace="Microsoft.Web.UI.WebControls" %>
Then, you add the toolbar to your page:
<iecontrols:Toolbar id="myToolbar" runat="server"> </ie:Toolbar>
Lastly, you add the buttons that you want to appear on your toolbar:
<iecontrols:Toolbar id="myToolbar" runat="server"> <iecontrols:ToolbarButton Text="First Button" /> <iecontrols:ToolbarSeparator /> <iecontrols:ToolbarButton Text="<b>Second Button</b>" /> </iecontrols:Toolbar>
Comments
The toolbar control is a quick way to get a nice-looking toolbar working on your site. Notice in this example that you can even add rich content to the button text. This enables you to use HTML on your buttons. You can also set the ImageUrl property of the button tag to use an image as your button.
See Also
Overview of ToolBar Controlhttp://msdn.microsoft.com/workshop/webcontrols/overview/toolbar.asp