how to set dataType jsonp in ajax.BeginForm in asp mvc 5

192 views Asked by At

i want set dataType jsonp in ajax.BeginForm for example this current code

Url = "/api/Phrase/Create",
OnSuccess = "OnSuccess(data)",
OnFailure = "OnFailure",
HttpMethod="POST"

change to

Url = "/api/v3/Phrase/Create",
OnSuccess = "OnSuccess(data)",
OnFailure = "OnFailure",
HttpMethod= "POST",
dataType= "jsonp"

like in jquery :

$.ajax({
            type: "POST",
            url: "/api/v3/Phrase/Create",
            dataType: "json",
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(model),
            success: function (data) { alert(data); },
            failure: function (errMsg) {
                alert(errMsg);
            }
});

if you can help Please replay to this request else Should do something thanks all

0

There are 0 answers