Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ASP.NET error with DropDownList

Posted on 2012-04-12
2
344 Views
Last Modified: 2012-06-27
I get the following error:

Parser Error

Parser Error Message: System.Web.UI.WebControls.ListItemCollection must have items of type 'System.Web.UI.WebControls.ListItem'. 'asp:DropDownList' is of type 'System.Web.UI.WebControls.DropDownList'.

The error comes from the following code:

<asp:DropDownList ID="GenericTypeBox" runat="server"
                                    DataSourceID="GenericLaborDataSource" DataTextField="code_value_desc"
                                    DataValueField="code_value" Visible="False">
0
Comment
Question by:zintech
2 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 37839397
The Problem is with your GenericLaborDataSource . . . you have the wrong type.

Change it from a ListItemCollection to a SqlDataSource.



See this:

http://stackoverflow.com/questions/805162/asp-net-drop-down-list-and-data-source-created-dynamically
0
 
LVL 14

Accepted Solution

by:
binaryevo earned 500 total points
ID: 37839406
From the code you posted, at first glance, it doesnt appear that the <asp:DropDownList tags are being closed correctly with either />  or </asp:DropDownList>
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question