To add Telerik RadToolBar to an ASP.NET WebForm you can use either of the following approaches:
If you intend to use skins different from the default or if you plan to modify the JavaScript files, you also need to manually copy the ToolBar subfolder under the RadControls folder from the Telerik RadToolBar installation folder to the root folder of your web application.
 |
Because of the specific control features, you will always need to copy RadControls for Telerik RadChart, Telerik RadEditor, Telerik RadSpell and Telerik RadWindow products. |
 |
If your RadControls folder contains multiple subfolders for Telerik controls - for example, if you are using a Telerik RadControls for ASP.NET installation as opposed to a Telerik RadToolBar installation - make sure you copy only the subfolders of the controls you are going to use (ToolBar and any other controls you need). Do not copy the subfolders of controls you are not planning to use as this may cause a number of compilation errors: Visual Studio 2005 compiles all files in the web project; errors occur when missing assemblies are not found. |
Adding Telerik RadToolBar to a WebForm using Visual Studio .Net
The easiest way to deploy Telerik RadToolBar is by dragging its icon from the Visual Studio .NET Toolbox in Design mode. Visual Studio will automatically copy the RadToolBar.NET2.dll to the bin folder of your web-application and will create the respective references. You only have to copy the RadControls folder to the root folder of your web application as explained above.
Adding Telerik RadToolBar to a WebForm manually
If you are not using Visual Studio .NET, you can deploy Telerik RadToolBar manually. Follow the instructions below:
- Copy the RadControls folder from the Telerik RadToolBar installation folder to the folder of your web application.
-
Copy the RadToolBar.NET2.dll from the bin folder of the Telerik RadToolBar installation to the bin folder of your web application.
-
Open your aspx/ascx file and add the Telerik RadToolBar Register directive at the top:
<%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadToolBar.Net2" %>
If you plan all pages in your application to use Telerik RadToolBar you can add the following lines in your web.config file. In this case you don't need to add this directive in your pages.
| |
Copy Code |
|
<pages> <controls> <add tagPrefix="rad" namespace="Telerik.WebControls" assembly="RadToolBar.Net2" /> </controls> </pages> |
-
Write the Telerik RadToolBar tags in the body of the WebForm:
| |
Copy Code |
|
<rad:RadToolBar ID="toolbar1" Runat="server"> </rad:RadToolBar> |
- Add any additional properties you need between the Telerik RadToolBar tags.
Troubleshooting: the css styles do not apply correctly
If you have a Telerik control in a user control with output caching turned on you should manually register all the required CSS files in the head tag of your page. Otherwise the control will not be displayed correctly. The easiest way to do this is through a LINK element:
|
<link href="~/RadControls/ToolBar/Skins/[SkinName]/styles.css"rel="stylesheet"runat="server"> |