@Html.DropDownList("ApplicableOn_", new List<SelectListItem>
{
new SelectListItem{ Text="<----Select--->", Value = "0" },
new SelectListItem{ Text="Bill", Value = "1" },
new SelectListItem{ Text="Product", Value = "2" }
}, new { style = " width: 100%; height: 22px;", @onchange = "Fillstates()" })
<script type="text/javascript">
function Fillstates() {
var Country_id = $('#ApplicableOn_').val();
$.ajax({
url: 'Fillstates',
type: "GET",
dataType: "JSON",
data: { Country_id: Country_id },
success: function (cities) {
$("#State_name").html("");
$.each(cities, function (i, city) {
$("#State_name").append(
$('<option></option>').val(city.State_id).html(city.State_name));
});
}
});
}
</script>
, can i resolve using same script and html helper
What I have tried:
Just i wanna to do call mentioned java script function on my on change event
, can i resolve using same script and html helper