Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding to asp:DropDownList manuallly not working

Status
Not open for further replies.

tshad

Programmer
Jul 15, 2004
386
US
I am getting this message:

System.Web.UI.WebControls.ListItemCollection must have items of type 'System.Web.UI.WebControls.ListItem'. 'ListItem' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.

My aspx code is:

<asp:DropDownList ID="ddlPerson" ToolTip="" runat="server" >
<ListItem value="0">[Select Person]</ListItem>
<ListItem value="1">tfstom2</ListItem>
<ListItem value="2">cspear</ListItem>
</asp:DropDownList>

Why is it getting the ListItem from the other namespace? This is a normal .aspx page.

Thanks,

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top