How to add Ektron server controls into Visual Studio

  • Updated

This is a quick tutorial on how to add the Ektron server controls to the toolbox of Visual Studio.

  1. Open your Ektron project in Microsoft Visual Studio (by clicking file open website choose the site root folder)
  2. Open the VS Toolbox.
  3. Add a tab and give it a name like Standard Ektron Controls
  4. Right click and select  Choose Items... .

Browse Controls

  1. Click  Browse .
  2. Choose  site root/bin/ Ektron.Cms.Controls.dll
  3. Click  OK .
  4. The controls appear on the Toolbox tab.

    Controls
  5. Repeat the sames steps to add:
    1. Ektron UI Controls - Ektron.Cms.Framework.UI.Controls.EktronUI.dll
    2. Ektron Templated Server Controls - Ektron.Cms.Framework.UI.Controls.dll

Should look like:

Controls2Controls3

 

To add the controls register statements are needed at the top of the .aspx page. For example:

<%@ Register assembly="Ektron.Cms.Framework.UI.Controls"
  namespace="Ektron.Cms.Framework.UI.Controls" tagprefix="ektron" %>

<%@ Register assembly="Ektron.Cms.Framework.UI.Controls.EktronUI" namespace="Ektron.Cms.Framework.UI.Controls.EktronUI" tagprefix="ektronUI" %>

You can modify the tagprefix value to something different. Make sure that the controls reflect what the tagprefix shows. 
e.g.

<ektronUI:DateField ID="DateField1" runat="server"></ektronUI:DateField>

Notice how the control's prefix matches the registration tagprefix value. If they do not match you will see errors like the following. 
Unknown server tag