Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
igGrid remote Paging/Filtering Anti Forgery Token
posted

I have an igGrid where i use remote paging/filtering.  On databind, I'm adding onto  "extraParams", however on my ASP.Net MVC Controller action I need to have the "__RequestVerificationToken" in the form data so the "ValidateAntiForgeryToken" attribute will work.  These parameters are only being put in the "request body".  How can I get them to work with the "ValidateAntiForgeryToken" attribute?

dataBinding: function (evt, ui) {
            ui.dataSource.settings.urlParamsEncoded = function (item, params) {
                var myParams = {
                    id: viewModel.Id()
                    , __RequestVerificationToken: viewModel.AntiForgeryToken()
                };
                params.extraParams = myParams;
            };
        }

Parents
  • 485
    Offline posted

    Hello Justin,

     

    Thank you for posting in our forum.

     

    Providing me with some more details regarding your scenario would be very appreciated and would allow me to give you a more precise answer:

     

    • How do you add the verification token to your View page? Is it possible for you to provide some of the code in the View that is doing it?
    • Are you sure you get the __RequestVerificationToken correctly and it is not "undefined" before adding it to the request parameters, in order to be sent to the server afterwards? 
    • Which version of Ignite UI do you use?

     

    If you need any additional assistance, feel free to contact me.

Reply Children