Q:

JQuery not returning successfully

This is the call to ajax for posting my form. 
<script type="text/javascript">

    $(function () {
        $("#GetReport").click(function () {               
            var d = {input:$("#frm").serialize()};                
            $.ajax({
                type: 'POST',
                url: '/Questions/Answer',
                data: JSON.stringify(d),
                dataType: "json",
                contentType: "application/json", 
                success: function (result) {
                    alert(result);
                }
            });
        });
    });

</script>

and this is my action
[HttpPost]
public ActionResult Answer(string input)
{
    return Content("Success");
}

When I press the relevant button, the action gets called but when the value returns, I expect an alert to be displayed saying "Success" but I get nothing despite my action getting called. 

A:

Try dataType: "text", since you seem to be returning a plain string (that is not in JSON format), and dataType specifies the expected response format, not the request format. (Or just remove the dataType option, in which case jQuery will make its own best guess at the what the response format is once it sees it.)

