ASP.Net MVC Error: Failed to load resource: the server responded with a status of 404

Last Reply 4 days ago By marcus

Posted 14 days ago

I have a problem here whenever I debug my application on the localhost, the application runs perfect with no errors but whenever I publish it, it give me this error:-

/Service_Bind?depart_id=1:1 Failed to load resource: the server responded with a status of 404 (Not Found) 

My Source Code for javascript: 

<script>
    $(document).ready(function () {
        $('#depart').change(function () {
            var id = $(this).val();
            $('#Service').empty();
            $.get('Service_Bind', { depart_id: id }, function (data) {
                var v = '<option>---Select---</option>';
                $.each(data, function (i, v1) {
                    v += '<option value=' + v1.Value + '>' + v1.Text + '</option>';

                });
                $('#Service').html(v).text();
            });
        });
    });
</script>

 

Posted 4 days ago Modified on 4 days ago

This is what I was suppose to add on the script and it worked. The only problem was to fetch a page so the browser didnt know where was it fetching. Thanks for your help. 

 $.get('@Url.Action("Gender_Bind", "Request")', { Service_id: id }, function (data)