New to Kendo UI for jQuery? Download free 30-day trial

Cannot Send AntiForgery Token

Environment

Product Progress® Kendo UI® DataSource for jQuery
Operating System Windows 10 64bit
Browser Google Chrome
Browser Version 56.0.2924.87 (64-bit)

Description

I use the transport.read.data method to send my anti-forgery token, but it is not available on the server.

How can I send my anti-forgery token when using Kendo UI for jQuery?

Solution

Send the anti-forgery token along with the request form data. In order for the anti-forgery token to be accessible on the server, read should make a POST request.

function readData() {

        var data = {
            __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val()
        };

        return data;

    }

In this article