Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I found the answer. Maybe it could be handy to someone. Actually the ajax call needs to be on the Block not on the Controller.
Here is the updated code:
function clickSubmit() {
$.ajax({
type: "POST",
url: '@Url.Action("Convert", "JumbotronConversionBlock")',
contentType: "application/json; charset=utf-8",
data: { a: "testing" },
dataType: "json",
success: function() { alert('Success'); },
error: function () { alert('Failed'); }
});
}
Hello Folks
I'm trying to call a controller with ajax and it keeps on failing. Anybody can help? Here is the code
Controller Code
Html Code
ERROR