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

How to prevent KendoUI on certain pages

1 Answer 7 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 04 Feb 2021, 07:42 PM

     Hello, I am using dotnet MVC 6 (not core) and I have a need to only allow the KendoUI on some pages but not others. I am using the controls on a form built before we bought KendoUI, some forms were pre-built using the dotnet mvc scaffolding tool. Those forms do not need the KendoUI emitters, which normally would not be a problem except that when I run the project I am getting the following error in chrome:

Uncaught ReferenceError: kendo is not defined

And the following code is included for each control on the page:

kendo.syncReady(function(){jQuery("#First_Name").kendoTextBox({"value":"James"});});

I have tried removing the javascript references and that did not work, the code still gets emitted. I know why it is happening, because the javascript files are loaded at the bottom of the page, way after the above script tries to execute. I can't use deferred as I am not using the Kendo helpers on this page. Is there any other way to do this besides moving the kendo controls to the top of the page? And, if I have to move the controls to the top of the page, can I do that without moving the bootstrap and jquery script calls to the top as well (IE., are the kendo scripts dependent on JQuery or Bootstrap to be initialized first)?

Thanks in advance...

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 08 Feb 2021, 04:30 PM

Hello, Paul,

Could you please go through this forum thread that discusses a similar topic? I think it covers all the possible approaches in your scenario so I hope it will be of help to you.

Let me know your thoughts if the information would be useful.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or