I am adding a new option to a asp.net dropdown and I am selecting this option. When the page is posted back, the option added and selected via JQuery isn't reflected from the code behind. What could be the issue.
Code below adding the option and selecting:
$("#DdlProductType").prepend($('<option>', { value: 'ALL', text: 'All' }));
$("#DdlProductType").prop('selectedIndex', 0);
Right before postback, javascript alert shows the correct option selected (ALL, index 0). But when retrieving the selected text and index of DdlProductType from code behind, another item is selected. I'm guessing this has something to do with the viewstate not being updated.
Thanks.