N
Nathan Sokalski
I am creating a control in which I inherit from the DropDownList. The only
method that I override is RenderContents. Here is my basic code:
Public Class StatesDropDownList : Inherits DropDownList
Protected Overrides Sub RenderContents(ByVal writer As
System.Web.UI.HtmlTextWriter)
'I add several items to the Items property here using Me.Items.Add()
MyBase.RenderContents(writer)
End Sub
End Class
However, when I attempt to add ListItems declaratively (by placing
<asp:ListItem/> tags between the opening and closing tags for my control),
Visual Studio 2005 tells me "Element 'ListItem' is not a known element." I
am inheriting from DropDownList, and DropDownList works fine even in the
same Page, so shouldn't my control allow <asp:ListItem/> tags as well? Any
help would be appreciated. Thanks.
method that I override is RenderContents. Here is my basic code:
Public Class StatesDropDownList : Inherits DropDownList
Protected Overrides Sub RenderContents(ByVal writer As
System.Web.UI.HtmlTextWriter)
'I add several items to the Items property here using Me.Items.Add()
MyBase.RenderContents(writer)
End Sub
End Class
However, when I attempt to add ListItems declaratively (by placing
<asp:ListItem/> tags between the opening and closing tags for my control),
Visual Studio 2005 tells me "Element 'ListItem' is not a known element." I
am inheriting from DropDownList, and DropDownList works fine even in the
same Page, so shouldn't my control allow <asp:ListItem/> tags as well? Any
help would be appreciated. Thanks.