Custom DropDownList control in ASP.NET 2.0



Hi

I've created a custom dropdown list in a web control library that my
aspx page uses as follows:

<%@ Register Assembly="CommonUI" Namespace="POLISY.Web.UI.Common"
TagPrefix="cc1" %>
....
<cc1:WFEDropDownList ID="WFEDropDownList1" runat="server">
<asp:ListItem Value="A">Apple</asp:ListItem>
<asp:ListItem Value="B">Banana</asp:ListItem>
</cc1:WFEDropDownList></td>

When I compile the .aspx I get the following error for each
<asp:ListItem> within a <cc1:WFEDropDownList> element:

Element 'ListItem' is not a known element. This can occur if there
is a compilation error in the Web site.

Any idea what's causing this? The code for WFEDropDownList is very
simple. All it does is extend DropDownList as follows:


using System.Web.UI;
using System.Web.UI.WebControls;
namespace POLISY.Web.UI.Common
{
[ToolboxData("<{0}:WFEDropDownList
runat=server></{0}:WFEDropDownList>")]
public class WFEDropDownList : DropDownList
{
// TO DO: Register javascript to display a tool tip for the
// currently selected item in the drop down. (needed in case
// of truncation)

}
}


Thanks for your help!

.



Relevant Pages

  • Asp:DropDown - get selected item
    ... I have an .aspx with some controls that are created dynamically. ... items are populated into the box by setting the DataSource-property to ... selected item is always the first item in the DropDown. ...
    (microsoft.public.dotnet.languages.csharp)
  • Asp:DropDown - get selected item
    ... I have an .aspx with some controls that are created dynamically. ... items are populated into the box by setting the DataSource-property to ... selected item is always the first item in the DropDown. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem with Object Reference?
    ... Is add_Office actually declared as a server side dropdown on your .aspx ... Basically, this kind of error happens when you declare the variable, but ... > Sub PopulateDropdown() ...
    (microsoft.public.dotnet.framework.aspnet)
  • how to program this?
    ... A is a dropdown with following values ... compile, edit, audit ...
    (microsoft.public.excel.programming)
  • if, else questions
    ... A is a dropdown with following values ... compile, edit, audit ...
    (microsoft.public.excel.newusers)