I am filling dropdownlist with javascript.
for (var i = 1; i < array.length; i++) {
var optn = document.createElement("OPTION");
optn.text = array[i];
optn.value = array[i];
document.getElementById('<%=ddlProductModel.ClientID%>').(options.addoptn);
}
But I can’t get selectedValue of dropdownlist on postback in codebehind(c#). Any solution pls? Thanks.
Yasin
You can not access selected element by
dropdownlist.SelectedValuewhen values added on client side. Try to useRequest.Form["dropdownlistid"]