Install ASP.NET Core UI manually, still uncorrect

4 posts, 1 answers
  1. K'Library
    K'Library avatar
    14 posts
    Member since:
    Aug 2015

    Posted 14 May 2019 Link to this post

    Hi, 

    I follow https://docs.telerik.com/aspnet-core/getting-started/getting-started this instruction to create a new asp.net core 2.1 mvc project to test Telerik UI for Asp.net Core version 2019.1.220

    I installed client resource manually following https://docs.telerik.com/aspnet-core/getting-started/getting-started-copy-client-resources#manual-installation . But the browsers console showed kendo js errors. I was sure I followed the instructions correctly, I don't know why it didn't work. 

    I zipped the codes and attached the download url in this thread:

    https://celiawestus2.blob.core.windows.net/publics/test/WebApplication1.7z 

    Could anyone help to solve this problem?

  2. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    2132 posts

    Posted 16 May 2019 Link to this post

    Hi,

    The cause for the exception you are experiencing is jQuery being loaded twice in the project's _Layout.cshtml. It is loaded once in the head tag:
    <environment include="Development"
            <script src="~/lib/jquery/dist/jquery.js"></script>
     
            @* Place Kendo UI scripts after jQuery *@
            <script src="~/lib/kendo-ui/js/kendo.all.min.js"></script>
            <script src="~/lib/kendo-ui/js/kendo.aspnetmvc.min.js"></script>
    </environment>

    and a second time at the end of the body:
    <environment include="Development">
        <script src="~/lib/jquery/dist/jquery.js"></script>
        <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
        <script src="~/js/site.js" asp-append-version="true"></script>
    </environment>

    The same is valid for the environment tags with exclude="Development" attribute:
    <environment exclude="Development">
    ...
    </environment>

    Loading jQuery multiple times should be avoided - it must be added only once on the page before the Kendo UI scripts.

    Leaving only the first reference to jQuery in the project's Layout deals with the js exception

    Regards,
    Ivan Danchev
    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.
  3. K'Library
    K'Library avatar
    14 posts
    Member since:
    Aug 2015

    Posted 16 May 2019 in reply to Ivan Danchev Link to this post

    Thanks, Visual Studio 2017 default asp.net core mvc templates contained this jquery.js.

    I saw that there was jQuery 3 or jQuery 2 in different examples. Which version of jQuery should I use for Telerik's control? If I want to keep compatible with default asp.net core mvc templates. 

  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2132 posts

    Posted 21 May 2019 Link to this post

    Hi,

    You can find the list of supported jQuery versions per release in this documentation section. By default Core projects use jQuery 3.3.1, which is supported since R2 2018. 

    Regards,
    Ivan Danchev
    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.
Back to Top