I'm currently having an issue while trying to pass Data to my controller in my MVC application.

Here is my code


                source: "/@Resources.Global.Lang/Client/AutoComplete?ID=" + $("#idNumber").val() + "&country=" + $("#country").val(),

                select: function (e, ui) {
                    var temp = $("#idNumber").val();
                    var temp2 = $("#country").val();
                        type: 'POST',
                        url: "/@Resources.Global.Lang/Client/searchClientByID?ID=" + temp + "&country=" + temp2,
                        dataType: 'json',
                        success: function (data) {



This is my DropDownlist

        @Html.DropDownList("country", ((ClientController)ViewContext.Controller).GetCountries(), "United Kingdom", new { @class = "dropDownCountry",@id = "country" })

My method in ClientController always receive the default value I set for that dropdownlist, in this case United Kingdom and even if I change it to another value.
Can someone help me out? I have no idea why my Dropdownlist selected value doesn't work whenever I call the autocomplete function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.