I am opening an kendo window using the below jquery function.
I need to pass __RequestVerificationToken
to the MVC Controller because I am having ValidateAntiForgeryToken
Attribute.
However, I am not able to pass it. Can you please suggest how to pass __RequestVerificationToken
while opening an kendoWindow
function OpenTest() {
var url = '@Url.ActionWithArea("OpenTest", "Test", GlobalConst.AREA_Test)';
url += "?test=" +$("#test").val() + "&test1=" +$("#test1").val();
windowElement = $('<div id = "abc" />').kendoWindow({
title: 'test',
content: url,
modal: true,
resizable: false,
draggable: false,
width: 900,
height: 400,
close: function () {
windowElement.destroy();
}).data("kendoWindow").center().open();
return false;
}
}
You will need to make a POST request when loading the template which would allow you to send your antiforgery token:
content: {
url: url,
type: 'POST',
data: {
'__RequestVerificationToken': 'the value of your token'
}
},