function SetDropDownValue() {
var opt = document.createElement("option");
opt.text = "New Value";
opt.value = "New Value";
document.getElementById('<%=DropDownList.ClientID%>').options.add(opt);
document.getElementById('<%=DropDownList.ClientID%>').value = val;
}
The above coding works good for me, The new value append to the drop down list while clicking the button. Then i want to get the drop down value in my code behind(C#). It not working in C#.
string res = DropDownList.SelectedValue;
In the C# coding displays only empty string ("").
How can i get the dropdown selected value?