Do you know hoy to add items to a dropdown? I have the following ascx code:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddComponentToBundleXPM.ascx.cs" Inherits="GUIPageViewExtension.AddComponentToBundleXPM" %>
<%@ Import Namespace="Tridion.Web.UI" %>
<c:RibbonItemsGroup runat="server" ID="RibbonItemsGroup">
<c:RibbonButton runat="server" CommandName="ViewStaging" Title="View in Staging" Label="View In Staging" ID="ViewStagingBtn" />
<c:RibbonButton runat="server" CommandName="ViewLive" Title="View in Live" Label="View in Live" ID="ViewLiveBtn" />
<c:Dropdown ID="listComponentTemplates" runat="server" nullable="false" />
</c:RibbonItemsGroup>
In codebehind, when I try to add items to this Dropdown, it doesn´t recognized this element (with ID listComponentTemplates). This is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Tridion.Web.UI.Core.Controls;
namespace GUIPageViewExtension
{
[ControlResources("GUIPageViewExtension.AddComponentToBundleXPM")]
public partial class AddComponentToBundleXPM : Tridion.Web.UI.Controls.TridionUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 7; i++)
{
ListItem element = new ListItem("Text " + i.ToString());
this.listComponentTemplate.
}
}
}
}
What could be the problem? Is there any way to do something like that?