Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nate M 16 posts 136 karma points
    Nov 02, 2023 @ 23:26
    Nate M
    0

    Html.RequireJs

    I'm somewhat new to Umbraco, but I'm moving from v8 to v12 and I'm trying to sort out some problems.

    I'm getting this error when using Html.RequireJs.

    'IHtmlHelper<dynamic>' does not contain a definition for 'RequiresJs' and no accessible extension method 'RequiresJs' accepting a first argument of type 'IHtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)
    

    Does anyone know how to resolve this in v12?

    Here is the code I'm using from v8.

    @{
    Html.RequiresJs("/scripts/modernizr-2.8.3.js",1);
    Html.RequiresJs("/scripts/jquery-1.11.2.min.js",2);
    Html.RequiresJs("/scripts/jquery.validate-vsdoc.js",3);
    Html.RequiresJs("/scripts/jquery.validate.min.js",4);
    Html.RequiresJs("/scripts/jquery.validate.unobtrusive.min.js",5);
    Html.RequiresJs("/scripts/jquery.form.min.js",6);
    Html.RequiresJs("/scripts/jQuery.tmpl.min.js",7);
    Html.RequiresJs("/scripts/moment.min.js",8);
    Html.RequiresJs("/scripts/bootstrap.min.js",9);
    Html.RequiresJs("/scripts/jquery.tiltedpage-scroll.js",10);
    Html.RequiresJs("/scripts/images.loaded.min.js",11);
    Html.RequiresJs("/scripts/jquery.waypoints.min.js",12);
    Html.RequiresJs("/scripts/parallax.min.js",13);
    Html.RequiresJs("/scripts/readmore.min.js",14);
    Html.RequiresJs("/scripts/app.js",15);
    Html.RequiresJs("/scripts/validations/moduleDependency.js",16);
    Html.RequiresJs("/scripts/data/ajax.js",17);
    Html.RequiresJs("/scripts/utils/common.js",18);
    Html.RequiresJs("/scripts/utils/dialog.js",19);
    Html.RequiresJs("/scripts/utils/alerts.js",20);
    Html.RequiresJs("/scripts/utils/template.js",21);
    Html.RequiresJs("/scripts/modules/base.js",22);
    Html.RequiresJs("/scripts/modules/accessibility.js",23);
    Html.RequiresJs("/scripts/modules/serviceCards.js",24);
    Html.RequiresJs("/scripts/site.js",25);
    Html.RequiresJs("/scripts/js-cookie.min.js",26);
    Html.RequiresJs("/scripts/cookies.js",27);
    
  • Yakov Lebski 591 posts 2346 karma points
    Nov 03, 2023 @ 03:45
    Yakov Lebski
    101

    use SmidgeHelper

        SmidgeHelper.RequiresJs(new JavaScriptFile() { FilePath = "~/lib/jquery/dist/jquery.min.js", Order = 1 });
    
Please Sign in or register to post replies

Write your reply to:

Draft