CheckBoxFor causing JavaScript error and not working

1 Answer 10 Views
Checkbox
Jonathan
Top achievements
Rank 1
Jonathan asked on 10 Apr 2025, 06:25 PM | edited on 10 Apr 2025, 06:42 PM

Hello I have the following MVC code in a .cshtml file for an ASP.MVC application:

@(Html.Kendo().CheckBoxFor(m => m.IsNotificationSuppressed).Checked(false).Label("some text"))

Until a few days ago, this line worked fine.  But we've recently updated Kendo to the most recent version and now it's throwing the following JavaScript error:

Uncaught TypeError: jQuery(...).kendoCheckBox is not a function

And the checkbox appears but without a label.

I've already determined that neither "m" (the view model) nor the property IsNotificationSuppressed are null.  I cannot find any information as to what is causing this CheckBoxFor to not function and its use here matches the examples given in every example I can find for the Kendo checkbox.

What is wrong here and how do I fix this?

Also the kendo.all.min.js file appears to be a 2016 version and ctrl-f for kendocheckbox finds nothing.  Is this the problem?  How do I update this file and why didn't it update when the rest of Kendo was updated?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 15 Apr 2025, 12:34 PM

Hello Jonathan,

 

The CheckBox component was introduced in R1 2022 SP1 version of the components. If the script files referenced in the project are older there will be no reference to kendoCheckBox. That said, make sure that the scripts and styles that are used in the project match the version of the components. 

When updating the components, references of the client resources need to be replaced manually with references to the updated version. You can replace them as described in the article below: 

https://www.telerik.com/aspnet-mvc/documentation/installation/upgrading/upgrade

Also, double check if there are multiple jQuery references in the project and remove any duplicates as this can also lead to unexpected behavior. 

In case the error persists, please share a sample project where the issue is reproduced. This will enable us to examine it and look for what is causing the behavior.

 

Regards,
Viktor Tachev
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
Checkbox
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or