Display (Show) filtered records in PartialView using jQuery AJAX in ASP.Net MVC

Last Reply 12 days ago By dharmendr

Posted 12 days ago

Hi,

I have one dropdowm Country

currently my requirement is that i need to filter records based upon Country

I need to display filter records in partialview

could you please help me 

<script type="text/javascript">
    $(document).ready(function () {
        $("#ddlCountry").on('change', function (e) {
            $.ajax({
                type: 'GET',
                url: "/Employee/Search",
                dataType: 'json',
                data: { country: $(this).find('option:selected').val() },
                success: function (response) {
                   
                },
                error: function () {
                }
            });
        });
    });
</script>
<select id="ddlCountry">
    <option value="0">Select</option>
    <option value="USA">USA</option>
    <option value="UK">UK</option>
    <option value="Canada">Canada</option>
</select>

@{
    Html.RenderPartial("~/Views/Employee/Filterrecords.cshtml");
}