I'm trying to populate on dropdown(i.e dropdown2) on the value basis of other dropdown(i.e dropdown1), It's populate fine,now my problem is when i'm click on asp button to get the selected value of dropdown 2 it will be return blank value, I'm not not understand what is going wrong?
HTML
<select runat="server" id="ddlFilter" ClientIDMode="Static">
<option value="0">Both</option>
<option value="1">Add new</option>
<select runat="server" id="ddlDepartment" ClientIDMode="Static"></select>
<asp:Button ID="btnSearch" runat="server" Text="Show Report" CssClass="search_btn" onclick="btnSearch_Click" />
JS
<script>
$(document).ready(function () {
$("#ddlFilter").change(function () {
if ($("#ddlFilter").val() > 0) {
$("#ddlDepartment").append( < option > New < option > );
}
});
});
</script>
C#
protected void btnSearch_Click(object sender, EventArgs e) {
string val= ddlDepartment.Value;
}