zintech
asked on
ASP.NET error with DropDownList
I get the following error:
Parser Error
Parser Error Message: System.Web.UI.WebControls. ListItemCo llection must have items of type 'System.Web.UI.WebControls .ListItem' . 'asp:DropDownList' is of type 'System.Web.UI.WebControls .DropDownL ist'.
The error comes from the following code:
<asp:DropDownList ID="GenericTypeBox" runat="server"
DataSourceID="GenericLabor DataSource " DataTextField="code_value_ desc"
DataValueField="code_value " Visible="False">
Parser Error
Parser Error Message: System.Web.UI.WebControls.
The error comes from the following code:
<asp:DropDownList ID="GenericTypeBox" runat="server"
DataSourceID="GenericLabor
DataValueField="code_value
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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