I want to get from post value in my class method via ajax call here is my html page
<form method="post">
<input type="text" name="text" />
<input type="email" name="email" />
<input type="file" name="file" />
<input type="date" name="date" />
<input type="submit" name="send" />
</form>
And this is my jquery code
$(document).ready(function () {
$('form').submit(function (e) {
var data = $(this).serializeArray();
var jsObj = {};
$.each(data, function (feild, value) {
jsObj[value.name] = value.value;
});
$.ajax({
url: "index.cs/addRow",
method: "post",
dataType: "json",
data: jsObj,
success : function(response){
console.log(response);
}
});
e.preventDefault();
});
And this is my c# code these is the method where i want post form
[WebMethod]
public static void addRow(object form)
{
var stuff = form;
}