This is a migrated thread and some comments may be shown as answers.

This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request.

2 Answers 545 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 09 Sep 2015, 11:48 AM

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

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 11 Sep 2015, 07:33 AM
Hi Mark,

This could happen if some of the required JavaScript files aren't included. Make sure that you have kendo.aspnetmvc.min.js included after kendo.all.min.js. Also check for any JavaScript errors that may have appeared in the browser console.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mark
Top achievements
Rank 1
answered on 11 Sep 2015, 03:38 PM

Thanks Atanas,

I checked and those script files are included in the right order, and there are no console errors.

It's not super important for us to be able to sort those columns so I'll leave it there - thank you for your time.

Thanks, Mark

Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Mark
Top achievements
Rank 1
Share this question
or