New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Dynamic Creation

This example demonstrates creating a RadSpell instance dynamically in the code-behind, and attaching it to a control.

Note that we work with control ID's, and they are setup by ASP.NET after we add the control to the form's Controls collection.

This is especially important when IsClientID is true and you are attaching to the ClientID of a control.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Spell.DynamicCreation.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-narrow">
        <asp:PlaceHolder ID="contentsHolder" runat="server"></asp:PlaceHolder>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance