Custom control with ListBox

K

kurt sune

I am trying to do a custom control wich extends the ordinary listbox with
some features.
The class is declared thus:
ParseChildren(True), _

ToolboxBitmap(GetType(ListBox)), _

DefaultEvent("SelectedIndexChanged")> _

Public Class eListBox

Inherits System.Web.UI.WebControls.ListBox



In the assembly info I say:

<Assembly: TagPrefix("CustomControlLibrary", "mir")>



When I in the IDE add items via ListItem Collection Editor

The resulting errormessage in the control in the ide: Rendering of the
control fails in the IDE.

The HTML looks like this:

<mir:eListBox ID="EListBox1" runat="server">

<asp:ListItem>one</asp:ListItem>

<asp:ListItem>two</asp:ListItem>

</mir:eListBox>

And the errormessage in erorlist is:

Error 4 Type 'CustomControlLibrary.eListBox' does not have a public property
named 'ListItem'. C:\Inetpub\wwwroot\CCLtest\eListBox.aspx 18

Error 5 Element 'ListItem' is not a known element. This can occur if there
is a compilation error in the Web site.
C:\Inetpub\wwwroot\CCLtest\eListBox.aspx 18 18 C:\...\CCLtest\




Anybody any ideas?
 
S

Steve

I am having the exact same problem with a control derived from DropDownList.
Additionally, I've noticed that Intellisense does not work between the main
tags of the control.

Any luck on finding an answer?

Steve
 
S

Steve

I have noticed that if do this...
<Items>
<asp:ListItem />
<asp:ListItem />
</Items>

the element not found error goes away. Intellisense still does not work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,091
Messages
2,570,604
Members
47,223
Latest member
smithjens316

Latest Threads

Top