I want to pass dynamic parameters in $.ajax function.
For that i am using following code:
$(function () {
var postData = 0;
$('#Index').submit(function () {
$.ajax({
type: 'POST',
url: "/Home/Index",
contentType: "application/json; charset=utf-8",
data: { 'tabindex':0},
dataType: "html",
success: function (data) {
alert('Inserted');
}
});
return false;
});
});
but still i m not getting the required result.
Can anybody tell me where i m wrong??
I got the answer for this instead of passing addition parameters i have use hidden fields.