アイテムではなくドロップダウンリストのテキストをクリアするコードが必要です。助けtextbox1.text=" ";
てください。
// I need dropdownlist clear like textbox.
TextBox1.Text = ""; //like this
アイテムではなくドロップダウンリストのテキストをクリアするコードが必要です。助けtextbox1.text=" ";
てください。
// I need dropdownlist clear like textbox.
TextBox1.Text = ""; //like this
DropDownList の 0 (1 番目) インデックスに空のエントリ (名前値) があると思います。
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="0">***Select***</asp:ListItem>
<asp:ListItem value="10">Foo</asp:ListItem>
<asp:ListItem value="20">Bar</asp:ListItem>
</asp:DropDownList>
DropDownList1.SelectedIndex または SelectedValue プロパティを使用して ListItem をリセットします。
DropDownList1.SelectedValue="0";
多分 ...
MyDropDownList.Items.Clear();