基本上,我拥有的代码来自于这里:http://ranafaisal.wordpress.com/2009/02/17/dynamically-adding-removing-textboxes-in-aspnet-repeater/。然而,问题在于我需要一个带有文本框的下拉列表。拥有下拉列表的目的是允许用户选择他们的原籍国。他们可以选择添加或删除之前输入的内容。
以下是我的错误信息:
'ddlName' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value 这是我在Default.aspx页面中使用repeater的dropdownlist代码。
以下是我的错误信息:
'ddlName' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value 这是我在Default.aspx页面中使用repeater的dropdownlist代码。
<asp:DropDownList ID="ddlName" runat="server" SelectedValue='<%# DataBinder.Eval(Container.DataItem, "ddl") %>'></asp:DropDownList>
下方的代码与我提供的链接完全相同。
- 需要注意的点:没有涉及到数据库。
请不要告诉我去谷歌或其他地方搜索,因为我已经搜索了几个小时,但毫无收获。我已经足够地搜索了,并尝试了其他人提供的解决方法,才来发布这个问题。我已经快到绝望的边缘了。
另外,由于下拉列表的问题,我甚至无法启动我的应用程序。
CheckBoxList
中使用这篇文章呢?我尝试了以下代码:<asp:CheckBoxList ID="chklWorkType" runat="server" OnDataBinding="chklWorkType_DataBinding" SelectedValue='<%# DataBinder.Eval(Container.DataItem, "WorkType") %>'></asp:CheckBoxList>
但是出现了错误。请问你能帮我解决吗? - Farzaneh Talebi