I am working C# MVC application and I have 2 action method in a controller:
[MultipleButton(Name = "action", Argument = "Save")]
public ActionResult SaveBasicInformation(FormCollection collection)
{.....}
[MultipleButton(Name = "action", Argument = "Submit")]
public ActionResult SubmitRequest(FormCollection collection)
{....}
The above code is working fine without ajax request. Now my question is how i can to pass "FormCollection" in $.ajax(..) for specific controller method.
var input = $(':input');
$.ajax({
url: '@Url.Action("SaveBasicInformation", "Home")',
type: 'POST',
cache: false,
data: input,
success: function (data) {
alert("Success");
},
error: function (result) {
alert("Error");
alert(result.responseText);
}
});
Here is the error message when i use the above ajax code:
The current request for action 'SaveBasicInformatio'' on controller type HomeController'
is ambiguous between the following action methods: System.Web.MVC.Action Result
SubmitRrquest(System.Web.formCollection)....
Thank you for your help...