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

Server-side Programming Overview

Updated on Nov 2, 2026

Overview of the Server-side APIs you can use to create and configure the Telerik WebForms AIPrompt Control.

Creating the AIPrompt in the Markup

To create an AIPrompt in the markup, add the RadAIPrompt element to the page and set its properties accordingly. You can find the properties in the following article:

Example: Create an AIPrompt in the markup

ASP.NET
<telerik:RadAIPrompt runat="server" ID="RadAIPrompt1" Width="300px" />

Creating the AIPrompt dynamically

To create the AIPrompt on the server, create a new instance of the RadAIPrompt object, set its properties and add it to the Controls collection of another control (e.g. PlaceHolder1).

Example: Create an AIPrompt dynamically during PreInit

C#
protected void Page_PreInit(object sender, EventArgs e)
{
    // Create dynamic controls during PreInit so they are restored on postback.
    RadAIPrompt aiPrompt = new RadAIPrompt()
    {
        Width = Unit.Pixel(400)
    };

    PlaceHolder1.Controls.Add(aiPrompt);
}

The PlaceHolder1

ASP.NET
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>

Creating controls programmatically must be done in an early event such as PreInit (preferably), Init. For more details you can check out the ASP.NET Page Life-Cycle Events

Next Steps