Hi there,
I've got a number of grids working fine in my application, but the most recent one is giving me this error when I try and sort columns :-
"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet"
The page loads fine, but it happens when I try and sort a column. The grid has one fixed column (this sorts fine) and a number of dynamically generated columns (the sorts on these don't work). The dynamically generated columns are populated on the databound event in jQuery, hence populating the dynamic columns.
Here is my view code :-
@(Html.Kendo().Grid<TEAMSPortalV2.Models.PortalUserTrainingViewModel>()
.Name("grid")
.Columns(columns => {
columns.Bound(p => p.Details).Hidden();
columns.Bound(p => p.PortalUserID).Hidden();
foreach (TEAMSPortalV2.Models.MyColumnSettings col in Model.GridColumns)
{
if (col.PropertyName == "PortalUser")
{
columns.Bound("PortalUser").Title(col.Title);
}
else
{
columns.Bound("").Title(col.Title);
}
}
})
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => {
model.Id(p => p.PortalUserID);
foreach (TEAMSPortalV2.Models.MyColumnSettings col in Model.GridColumns)
{
if (!col.Editable) {
model.Field(col.PropertyName, col.ColType).Editable(false);
}
}
})
.Read(read => read.Action("GetPortalUserTrainings", "Training"))
)
.Events(events => events
.DataBound("onDataBound_portalUserTraining")
)
)
I tried modifying the controller to allow get - this allowed the request to be processed but instead it just drew the raw JSON of the response onto the screen rather than loading it into the grid.
Do you know how I can fix this? Or if there is a client-side way of sorting that doesn't have this issue, instead that would also be an acceptable solution too.
Thanks, Mark