I have a partial view that contains a registration form with the following fields:
- First Name
- Last Name
- Password
I am posting the form using jQuery Ajax without using View Model.
Question : Is it a good approach to not use View Model in his context ?
Question : Is my approach useless in case of unit test cases?
jQuery
$.ajax({
url: "@Url.Action("Action", "Controller", new { area = "Area" })",
type: "POST",
contentType: 'application/json; charset=utf-8',
dataType: "json",
data: JSON.stringify({mail : "mails", nam : nam ......}),
traditional: true,
success: function (data) {
alert("wsaved");
}
});
[HpPost]
public Actionresult abc(string mail, string nam, sring lasnam)
{
return Json(new {succss = ru});
}