If I add some OPTION’s to a select list from client side javascript, that seems to break this control. Is this what’s supposed to happen?
IE, once I do this, I cannot get the value of my select list via going selectList.Value in c#.
I can’t even seem to change this element to not be a runat=server, it seems to disappear from the request.forms collection.
var Items = response.d;
var options = '';
$.each(Items , function (index, Item) {
options += '<option value="' +
Item.ItemID) + '">' +
Item.Name +
'</option>';
});
//alert(options);
$('#object_id').html(options);
I believe there’s some weirdness in general with select lists and innerHTML; not sure if that’s what jQuery uses in the background, but you might be better off adding the option elements directly using append() rather than through html().
http://www.sitecrafting.com/blog/ltselectgt-tag-innerhtml/