Adding the Telerik® UI for ASP.NET AJAX controls to your application or WebForm is straightforward and this article explores the requirements and the most common ways to do that.
This article contains the following sections:
Prerequisites — the main requirements the server, development machine and current Web Application/Web Site must satisfy so you can use the Telerik controls.
Adding Telerik Controls to a WebForm — explains how you can add and use the controls themselves on a form after the core requirements are satisfied.
To add Telerik® UI for ASP.NET AJAX to an existing ASP.NET web application you need to follow these steps:
Make sure you have installed ASP.NET AJAX, which comes as part of .NET 3.5+ installations.
If your web application is not using ASP.NET AJAX you need to configure it to do so. Detailed instructions can be found at [How Do I:] Add ASP.NET AJAX Features to an Existing Web Application?.
Add the needed HTTP handlers in the web.config as described in the web.config Settings Overview article.
You can use the Telerik Creation and Configuration Wizard to get the needed assemblies, their references and the web.config settings added to the solution. Alternatively you can log into Your Telerik.com account and obtain the Telerik.Web.UI.dll and other assemblies from the Telerik_UI_for_ASP.NET_AJAX_20xx_x_xxx_Dev_hotfix.zip installation.
Add a ScriptManager control on top of the page in which you are going to add any control.
<asp:ScriptManager ID="ScriptManager1" runat="server" />
If your page is a content page/user control you can add the ScriptManager control in your master/main page. For further details about the ScriptManager control you can check https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.scriptmanager?view=netframework-4.8.
Alternatively, you can use a RadScriptManager which extends the standard ScriptManager control and adds more features to it.
To add a Telerik control to an ASP.NET WebForm, you can use either of the following approaches:
The easiest way to add a Telerik Control is by dragging its icon from the Visual Studio .NET Toolbox in Design mode. Visual Studio will automatically copy the Telerik.Web.UI.dll to the bin folder of your web-application and will create the respective references.
If you do not see the controls in the toolbox, examine the Adding the Telerik Controls to the Visual Studio Toolbox article.
You can add any Telerik Control manually to the page by following the instructions below.
Copy the Telerik.Web.UI.dll from the binXX folder of the Telerik® UI for ASP.NET AJAX installation to the bin folder of your web application (where XX specifies the version of the .NET framework against which the assembly is built) and reference it. You can read more about the assemblies that come with your installation in the Included Assemblies article.
Open your aspx/ascx file and add the Telerik® UI for ASP.NET AJAX Register directive at the top so that Visual Studio recognizes our control tags:
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> ````
If many pages in your application will use Telerik controls, you can add the following lines in your web.config file so you don't need to add the register directive in every page/user control.
<pages> <controls> <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" /> </controls> </pages> ````
Write the product tags in the body of the Web Form. For example:
<form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> <telerik:RadTextBox RenderMode="Lightweight" ID="RadTextBox1" Text="Some Text" runat="server" /> <telerik:RadPushButton RenderMode="Lightweight" ID="RadButton1" runat="server" Text="Submit"></telerik:RadPushButton> </form> ````
AJAX-based controls like ours must be placed on the page after ScriptManager's declaration and inside the
<form>tag. Please also make sure that the RenderMode property of the Telerik controls is set to Lightweight.
To configure a control, you can:
Use the built-in properties from the markup or the code-behind.
Use the inner tags of the control.
Use the configuration wizard in the Visual Studio Designer.
You can read more about the individual controls' properties and features in their respective sections in the documentation, demos and by using the intellisense in Visual Studio.