$.ajax({
type: 'POST',
url: '@Url.Action("AccountUpdate", "Customer")',
async: false,
data: { a:"ed", formCollection: $("#form1").serialize() }
});
Controller:-
public void AccountUpdate(string a, FormCollection formCollection) {}
Question:- In controller AccountUpdate I am getting parameter a ="ed" which is fine. But in FormCollection object I am getting the formCollection object and also the 'a' object Why the form collection object receiving the 'a' object ? It should be only formCollection object
FormCollectionwhich is the collection of all submitted data. Replace it withYourModel formCollectionWhereYourModelis the model you used in the view.dataoption is not correct. Just start by usingdata: $("#form1").serialize(),to ensure your model is binding correctly and I'll then show you how to send back the additional parameter