I am developing one asp.net application. I have implemented asp.net dropdownlistbox with jquery multiselect option. users can select more than one values in dropdownboxlist. I want these selected values in server side on buttonclick event. I am getting selected all values in javascript. I am trying to get all the values inside button click event. Other than ajax is there any way to access multiple selected values in server side? Any help would be appreciated. This is my dropdownbox.
<h3>Awarded To: <asp:DropDownList ID="ddlvendors" CssClass="limitedNumbSelect2" Multiple="True" runat="server" Width="30%"></asp:DropDownList></h3>
I am binding values in server side on page load event.
This is my previous code.
$(".limitedNumbSelect2 option").each(function () {
var val = $(this).val();
var tempVal = $(".limitedNumbSelect2").val();
if (tempVal.indexOf(val) >= 0 && selected.indexOf(val) < 0) {
selected.push(val);
} else if (tempVal.indexOf(val) < 0 && selected.indexOf(val) >= 0) {
selected.splice(selected.indexOf(val), 1);
}
})
This is the code to enable all the checkboxes based on selected values from dropdownlist.
$('#<%= gdvRegretletter.ClientID %> input[type="hidden"]').each(function () {
$(this).closest('tr').find('input[type="checkbox"]').prop('disabled', false);
});