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

How do I include filter id and forgeryToken in Cascading DropDownList

4 Answers 199 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jimmy
Top achievements
Rank 1
Iron
Veteran
Jimmy asked on 08 Mar 2019, 08:02 AM

Hi

Can anyone help?

How do I include  filter id and forgeryToken in Cascading DropDownList?

Thanks in advance.

 

@(Html.Kendo().DropDownList()
    .Name("Transferee")
    .HtmlAttributes(new { style = "width:100%" })
    .OptionLabel("Select Transferee")
    .DataTextField("UName")
    .DataValueField("IContactId")
    .Filter(FilterType.Contains)
    .DataSource(dataSource => dataSource
    .Ajax()
    .Read(r => r.Url("?handler=Transferee").Data("forgeryToken").Data("filterAgency"))
    .Events(e => e.Error("onError").RequestEnd("onRequestEnd")))
    .Enable(false)
    .AutoBind(false)
    .CascadeFrom("Agency")
)

4 Answers, 1 is accepted

Sort by
0
Misho
Telerik team
answered on 12 Mar 2019, 02:13 PM
Hello,

We have the following online demo that showcases an example of Kendo cascading DropDownList setup that you could use as a reference. In case you are experiencing difficulties with configuring the Kendo DropDownList with cascading in your setup, please send us a sample runnable project that demonstrates the issue so we could be able to run it locally, investigate the case on our side and do our best to provide you with more detailed information and reliable solution.

Best Regards,
Misho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jimmy
Top achievements
Rank 1
Iron
Veteran
answered on 13 Mar 2019, 02:13 AM

HI Thanks for the reply, but your sample does not include forgeryToken passing.

My question us how do I pass in 2 parameters, main ID and forgertToken?

Below code does not work. 

.Read(r => r.Url("?handler=Transferee").Data("forgeryToken").Data("filterAgency"))

0
Jimmy
Top achievements
Rank 1
Iron
Veteran
answered on 13 Mar 2019, 04:11 AM

found a solution by combining both token and ID Json. 

.Read(r => r.Url("?handler=Transferee").Data("filterAgency"))

 

<script>

    function filterAgency() {

        var temp = $.extend(true, {}, kendo.antiForgeryTokens(), { agency: 1 });
        return temp;
    }

</script>

 

0
Misho
Telerik team
answered on 15 Mar 2019, 01:12 PM
Hi,

I'm glad that you managed to implement the desired behavior. 
In case you have other questions related to using  Kendo UI components, please do not hesitate to contact us.

Best Regards,
Misho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DropDownList
Asked by
Jimmy
Top achievements
Rank 1
Iron
Veteran
Answers by
Misho
Telerik team
Jimmy
Top achievements
Rank 1
Iron
Veteran
Share this question
or