This is your script,
<script type="text/javascript">
function abc()
{
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Webmethod.aspx/BindDataToDropDown",
data: "{}",
dataType: "Json",
success: function (data) {
$.each(data.d, function (index, value) {
var newOption = $('<option>');
newOption.attr('value', index).text(value.CourseLevel);
$('#DropDownList1').append(newOption);
})
}
});
}
</script>
Here is your HTML code
<form id="form1" runat="server">
<input type="button" value="Call" id="btn" name="btn" onclick="abc();" />
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</form>