I've defined a function named Bind\_ChainHotel in javascript on the Change of dropdown selection, i fill data into another dropdown through ajax. I am using HtmlHelper.DropDownList in MVC5. Whenever i select any option i got this error in console.

```
 @Html.DropDownList("ddlShellLevel", new List<SelectListItem>
                                                    {
                                                        new SelectListItem{Text="Chain",Value= "1"},
                                                        new SelectListItem{Text="Hotel",Value= "2"}
                                                    }, "Select Level", new { onchange = "Bind_ChainHotel(this.value);", @class = "form-control" })

```

**Javascript**

```
(function Bind_ChainHotel(id) {
    $.ajax({
        url: '@Url.Action("Bind_ChainHotel", "Shell")',
        type: "POST",
        data: { "id": id },
        success: function (data) {
            $("#ddlChain_Hotel").empty();
            $.each(data, function (i, chain_hotel) {
                $("#ddlChain_Hotel").append('<option value="' + chain_hotel.Value + '">' +
                     chain_hotel.Text + '</option>');
            });
            if (id == 1) {
                $('#lblChainHotel').text('Select Chain');
                $("#ddlChain_Hotel").prepend('<option value="0">Select Chain</option>');
            }
            else {
                $("#lblChainHotel").text("Select Hotel");
                $("#ddlChain_Hotel").prepend('<option value="0">Select Hotel</option>');
            }
        }
    });
})();

```