Asp.net 我可以在dropdownlist中有一个值为0的listitem和一个空的文本字符串吗?

Asp.net 我可以在dropdownlist中有一个值为0的listitem和一个空的文本字符串吗?,asp.net,drop-down-menu,Asp.net,Drop Down Menu,我的asp.net dropdownlist中需要一个listitem,它的值为0,文本为空字符串。我在代码中将db查询的结果附加到它。如果我有以下标记,则它将值和文本都呈现为0: <asp:DropDownList id="dd1" runat="server" AppendDataBoundItems="true"> <asp:ListItem Value="0"></asp:ListItem> </asp:DropDownList>

我的asp.net dropdownlist中需要一个listitem,它的值为0,文本为空字符串。我在代码中将db查询的结果附加到它。如果我有以下标记,则它将值和文本都呈现为0:

<asp:DropDownList id="dd1" runat="server" AppendDataBoundItems="true">
   <asp:ListItem Value="0"></asp:ListItem>
</asp:DropDownList>

有没有一种方法可以让它按照我想要的方式运行,而无需在代码中插入listitem对象


谢谢

设置
文本
属性,例如

<asp:DropDownList id="dd1" runat="server" AppendDataBoundItems="true">
   <asp:ListItem Value="0" Text="" />
</asp:DropDownList>


你试过了吗?@Chis Carew,你应该把这个作为答案,这样我就可以投票支持你了。现在我讨厌vs ide intellisense。在html编辑器中,它没有给我这个选项。它起作用了!