I have a problem with Select2 V 4.02
Here is my code
<select id="MySelect" class="form-control" runat="server" ClientIDMode="static">
<option></option>
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
</select>
<asp:Button Text="Show Select2 Result" runat="server" ID="btnShow" OnClick="btnShow_Click"/>
jQuery:
$('#MySelect').select2({
placeholder: "-Select-"
});
My question is: Can I get the "MySelect" selected value from ASP .Net Code behind? I tried this code from code behind asp .net webform
protected void btnShow_Click(object sender, EventArgs e)
{
Response.Write(MySelect.Value);
}
But it returns empty string.