<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#Tables').change(function () { var id = $('#Tables').val(); alert(id); $.ajax({ type: "POST", url: '@Url.Action("GetColumnnames", "MCPAdmin")', data: { Tables: $('#Tables').val() }, datatype: "json", traditional: true, success: function (data) { $('#AvailableFields').empty(); //iterate over the data and append a select option $.each(data, function (item) { $('#AvailableFields').append('<option value="' + item.Values + '">' + + '></option>'); }) } }); }); }); </script>