I have the following options.
1. Use the Ajax Begin Form with AjaxOptions as shown below
@using (Ajax.BeginForm("ActionName", "ControllerName", new { area = "AreaName" }, new AjaxOptions { HttpMethod = "POST", OnSuccess = "alert('Success');" //This will execute once the Ajax call is finished. }, null)) { <input type="submit" name="nameSubmit" value="Submit" /> }
2. Use jQuery to manually install the XHR query
$.ajax({ url: "@Url.Action("ActionName", "ControllerName", new { area = "AreaName" });", type: 'POST', contentType: 'application/json; charset=utf-8', data: JSON.stringify({param : Value}) }) .done(function () { alert('Success');})
My suggestions
When using FormCollection
The following disadvantages exist:
Point - 1
In the case of using FormCollection ... Mandatory Type Cast value of Primitive Type not necessary, because when receiving a record of a specific index System.Collections.Specialized.NameValueCollection , the return value is of type String . This situation does not occur in the case of strongly typed View-Models .
Problem - 2
When you submit the form and go to the Post Action Method and View-Model as a parameter in the Action method, you have a condition to send the submitted View values ββback. Otherwise, write the code again to send back via TempData/ViewData/ViewBag

Point - 3
We have data annotations that can be implemented in the View Model or Custom Validations .

ASP.Net MVC simplifies validation modeling using Data Annotation. Data annotations are attributes that apply to properties. We can create our own verification attribute by inheriting the built-in verification attribute class.
Point - 4
For example, you have the following HTML
<input type="text" name="textBox1" value="harsha" customAttr1 = "MyValue" />
Question How can we access the value of customAttr1 from the above, for example, from inside the controller
Answer : when submitting the form, only the name and value of the elements are sent back to the server. You can also use hidden fields to publish the Attributes to Post Action method.
Alternatives . Use jQuery bit to get custom attribute values ββand send them along with form values ββto the action method
Another option is to rather place what you got in your user attributes in hidden controls.
For this reason, I would always prefer to use View-Models