Javascript 重置ASP dropdownlist AppendDataBoundItems
我在asp中有以下dropdownlist:它绑定到SQL数据库以基于查询检索值Javascript 重置ASP dropdownlist AppendDataBoundItems,javascript,c#,asp.net,dropdown,Javascript,C#,Asp.net,Dropdown,我在asp中有以下dropdownlist:它绑定到SQL数据库以基于查询检索值 <td> <asp:DropDownList ID="DropDownList4" runat="server" AppendDataBoundItems="true" DataSourceID="SqlDataSource1" DataTextField="VALUE" DataValueField="VALUE"> <asp:ListItem Value=" " S
<td>
<asp:DropDownList ID="DropDownList4" runat="server" AppendDataBoundItems="true"
DataSourceID="SqlDataSource1" DataTextField="VALUE" DataValueField="VALUE">
<asp:ListItem Value=" " Selected="true" Text="--Select One--"></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand="SELECT "VALUE" FROM TABLENAME WHERE (column= xx)">
</asp:SqlDataSource>
问题是我想做第一个选择——选择一个--
现在,当我想重置文本字段时,我想在javascript中将下拉列表重置为值---select one---,但我不能
我在asp.net中重置了TextFild,如下所示:
document.getElementById('<%= txt_field01.ClientID %>').value = '';
document.getElementById('<%= txt_field01.ClientID %>').value = '';
document.getElementById(“”).value=“”;
document.getElementById(“”).value=“”;
我需要你的支持和想法
var drop = document.getElementById('<%=dropdownID.ClientID%>').querySelectorAll("option:selected");
或
或
谢谢你的回答,但这不起作用,它在var行给了我无效的参数
$(drop).empty();
drop.value = '';
$('#mydropID').val('');