Hai all, I have a problem calling asp:dropdownlist value in .js file. i have two page named with file.ascx and file.js pages
i am using Script option to link the two files
<script src="../../Scripts/file.js" type="text/javascript"></script>
in file.ascx page i have dropdownlist like below
<asp:DropDownList ID="dropdownlist1" runat="server" AppendDataBoundItems="true" DataSourceID="SqlDataSource1" DataTextField="DTF" DataValueField="DVF">
<asp:ListItem Value="0"><--Select--></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Connection %>"
SelectCommand="Select Statement">
</asp:SqlDataSource>
i want to call the above dropdownlist in file.js
i am used the below methods but i dont get dropdownlist id
document.getElementById('<%=dropdownlist1.ClientID%>').value = "other";
document.getElementById('dropdownlist1').value = "other";
but i am not getting the dropdownlist id