how do i retrieve a parameter?

Assuming you want to keep your controller method as it is, an HttpGet request, you need to change your ajax, please change to the following:

$.ajax({
            url: "/SendEmails/sendStudentMailIR/" + studentID + "/" + email + "/" + surID,
            //data: JSON.stringify(ko.toJSON(this)), no need to set data as they are passed in the url
            type: 'GET', //You have a controller method of Get not Post
            dataType: 'json',
            contentType: 'application/json',
            cache: false, //don't cache this request
            success: function (data) {
                alert("Send");
            },
            error: function(jqXHR, exception){ //Added error for exception handling

            }
        });

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top