I try to send antiforgerytoken and yeniTest is filled by some data ( it is not null ) to controller via below code at html page.
var token = document.querySelector('input[name="__RequestVerificationToken"]').value;
$.ajax({
url: '@Url.Action("/TestCevabı")',
type: 'post',
data: { __RequestVerificationToken: token, yeniTest: JSON.stringify(yeniTest)},
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
traditional: true
});
Controller method is like below
[HttpPost]
[ValidateAntiForgeryToken]
public bool TestCevabı(Test yeniTest)
{
///
}
I pass ValidateAntiForgeryToken at controller method.But yeniTest at TestCevabı method is null.