How do I use Microsoft.jQuery.Unobtrusive.Ajax with libman (Library manager) asp.net Core 2.1?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite












I am trying to use unobtrusive ajax to update my partial views. Unfortunately I ran in to a problem when I was about to install the package, since Bower is not working (?) or recommended anymore according to https://docs.microsoft.com/en-us/aspnet/core/client-side/bower?view=aspnetcore-2.1. Instead they recommend us to use Libman.



I followed the steps from https://www.c-sharpcorner.com/article/unobtrusive-ajax-and-jquery-for-partial-updates-in-asp-net-mvc/.



So I have installed the nuget Microsoft.jQuery.Unobtrusive.Ajax-package, but how do I reference the ajax-package with libman?



I looked at this How to reference Microsoft.JQuery.Unobtrusive.Ajax within my ASP.NET Core MVC project answer but it only shows how to use Bower.







share|improve this question


























    up vote
    6
    down vote

    favorite












    I am trying to use unobtrusive ajax to update my partial views. Unfortunately I ran in to a problem when I was about to install the package, since Bower is not working (?) or recommended anymore according to https://docs.microsoft.com/en-us/aspnet/core/client-side/bower?view=aspnetcore-2.1. Instead they recommend us to use Libman.



    I followed the steps from https://www.c-sharpcorner.com/article/unobtrusive-ajax-and-jquery-for-partial-updates-in-asp-net-mvc/.



    So I have installed the nuget Microsoft.jQuery.Unobtrusive.Ajax-package, but how do I reference the ajax-package with libman?



    I looked at this How to reference Microsoft.JQuery.Unobtrusive.Ajax within my ASP.NET Core MVC project answer but it only shows how to use Bower.







    share|improve this question
























      up vote
      6
      down vote

      favorite









      up vote
      6
      down vote

      favorite











      I am trying to use unobtrusive ajax to update my partial views. Unfortunately I ran in to a problem when I was about to install the package, since Bower is not working (?) or recommended anymore according to https://docs.microsoft.com/en-us/aspnet/core/client-side/bower?view=aspnetcore-2.1. Instead they recommend us to use Libman.



      I followed the steps from https://www.c-sharpcorner.com/article/unobtrusive-ajax-and-jquery-for-partial-updates-in-asp-net-mvc/.



      So I have installed the nuget Microsoft.jQuery.Unobtrusive.Ajax-package, but how do I reference the ajax-package with libman?



      I looked at this How to reference Microsoft.JQuery.Unobtrusive.Ajax within my ASP.NET Core MVC project answer but it only shows how to use Bower.







      share|improve this question














      I am trying to use unobtrusive ajax to update my partial views. Unfortunately I ran in to a problem when I was about to install the package, since Bower is not working (?) or recommended anymore according to https://docs.microsoft.com/en-us/aspnet/core/client-side/bower?view=aspnetcore-2.1. Instead they recommend us to use Libman.



      I followed the steps from https://www.c-sharpcorner.com/article/unobtrusive-ajax-and-jquery-for-partial-updates-in-asp-net-mvc/.



      So I have installed the nuget Microsoft.jQuery.Unobtrusive.Ajax-package, but how do I reference the ajax-package with libman?



      I looked at this How to reference Microsoft.JQuery.Unobtrusive.Ajax within my ASP.NET Core MVC project answer but it only shows how to use Bower.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 30 at 8:15









      mybirthname

      15k32042




      15k32042










      asked Aug 30 at 7:28









      Erik Sellberg

      211418




      211418






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          You could use npm. Add pakage.json file in the root of your web project




          "version": "1.0.0",
          "name": "your-system",
          "devDependencies":
          "jquery-ajax-unobtrusive": "^3.2.4"
          ,
          "exclude": [
          ]



          Now everything related to the library will be automatically downloaded in node_modules/jquery-validation-unobtrusive.



          Be aware the node_module folder is not part of the project so you need to click Show All Files to see all folders.



          enter image description here



          After that if you want to always have latest version of the library instead of copying the file to your js folder you could use bundle config. Run this:



          Install-Package BuildBundlerMinifier -Version 2.8.391


          After that create json file - bundleconfig.json in the root of your web project



          [ 

          "outputFileName": "wwwroot/js/myjs.min.js",
          "inputFiles": [
          "node_modules/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"
          ]


          ]


          This will create on every build myjs.min.js file in your js folder in wwwroot






          share|improve this answer





























            up vote
            1
            down vote













            The answer by @mybirthname is great . Another way to do that is to use libman cli . We can use the following command to install the libman :



            dotnet tool install --global Microsoft.Web.LibraryManager.Cli


            And now you can install jquery , jquery-validation-unobtrusive and so on as you like :



            to init a libman.json :



            libman init 


            to install a dependency of jquery-validation-unobtrusive:



            > libman install jquery-validation-unobtrusive
            Destination [libjquery-validation-unobtrusive]:
            lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js written to disk
            lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js written to disk
            Installed library "jquery-validation-unobtrusive@3.2.10" to "libjquery-validation-unobtrusive"


            to install a depenency of jquery:



            > libman install jquery
            Destination [libjquery]:
            lib/jquery/core.js written to disk
            lib/jquery/jquery.js written to disk
            lib/jquery/jquery.min.js written to disk
            lib/jquery/jquery.min.map written to disk
            lib/jquery/jquery.slim.js written to disk
            lib/jquery/jquery.slim.min.js written to disk
            lib/jquery/jquery.slim.min.map written to disk
            Installed library "jquery@3.3.1" to "libjquery"





            share|improve this answer




















              Your Answer





              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52091425%2fhow-do-i-use-microsoft-jquery-unobtrusive-ajax-with-libman-library-manager-asp%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote



              accepted










              You could use npm. Add pakage.json file in the root of your web project




              "version": "1.0.0",
              "name": "your-system",
              "devDependencies":
              "jquery-ajax-unobtrusive": "^3.2.4"
              ,
              "exclude": [
              ]



              Now everything related to the library will be automatically downloaded in node_modules/jquery-validation-unobtrusive.



              Be aware the node_module folder is not part of the project so you need to click Show All Files to see all folders.



              enter image description here



              After that if you want to always have latest version of the library instead of copying the file to your js folder you could use bundle config. Run this:



              Install-Package BuildBundlerMinifier -Version 2.8.391


              After that create json file - bundleconfig.json in the root of your web project



              [ 

              "outputFileName": "wwwroot/js/myjs.min.js",
              "inputFiles": [
              "node_modules/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"
              ]


              ]


              This will create on every build myjs.min.js file in your js folder in wwwroot






              share|improve this answer


























                up vote
                4
                down vote



                accepted










                You could use npm. Add pakage.json file in the root of your web project




                "version": "1.0.0",
                "name": "your-system",
                "devDependencies":
                "jquery-ajax-unobtrusive": "^3.2.4"
                ,
                "exclude": [
                ]



                Now everything related to the library will be automatically downloaded in node_modules/jquery-validation-unobtrusive.



                Be aware the node_module folder is not part of the project so you need to click Show All Files to see all folders.



                enter image description here



                After that if you want to always have latest version of the library instead of copying the file to your js folder you could use bundle config. Run this:



                Install-Package BuildBundlerMinifier -Version 2.8.391


                After that create json file - bundleconfig.json in the root of your web project



                [ 

                "outputFileName": "wwwroot/js/myjs.min.js",
                "inputFiles": [
                "node_modules/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"
                ]


                ]


                This will create on every build myjs.min.js file in your js folder in wwwroot






                share|improve this answer
























                  up vote
                  4
                  down vote



                  accepted







                  up vote
                  4
                  down vote



                  accepted






                  You could use npm. Add pakage.json file in the root of your web project




                  "version": "1.0.0",
                  "name": "your-system",
                  "devDependencies":
                  "jquery-ajax-unobtrusive": "^3.2.4"
                  ,
                  "exclude": [
                  ]



                  Now everything related to the library will be automatically downloaded in node_modules/jquery-validation-unobtrusive.



                  Be aware the node_module folder is not part of the project so you need to click Show All Files to see all folders.



                  enter image description here



                  After that if you want to always have latest version of the library instead of copying the file to your js folder you could use bundle config. Run this:



                  Install-Package BuildBundlerMinifier -Version 2.8.391


                  After that create json file - bundleconfig.json in the root of your web project



                  [ 

                  "outputFileName": "wwwroot/js/myjs.min.js",
                  "inputFiles": [
                  "node_modules/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"
                  ]


                  ]


                  This will create on every build myjs.min.js file in your js folder in wwwroot






                  share|improve this answer














                  You could use npm. Add pakage.json file in the root of your web project




                  "version": "1.0.0",
                  "name": "your-system",
                  "devDependencies":
                  "jquery-ajax-unobtrusive": "^3.2.4"
                  ,
                  "exclude": [
                  ]



                  Now everything related to the library will be automatically downloaded in node_modules/jquery-validation-unobtrusive.



                  Be aware the node_module folder is not part of the project so you need to click Show All Files to see all folders.



                  enter image description here



                  After that if you want to always have latest version of the library instead of copying the file to your js folder you could use bundle config. Run this:



                  Install-Package BuildBundlerMinifier -Version 2.8.391


                  After that create json file - bundleconfig.json in the root of your web project



                  [ 

                  "outputFileName": "wwwroot/js/myjs.min.js",
                  "inputFiles": [
                  "node_modules/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"
                  ]


                  ]


                  This will create on every build myjs.min.js file in your js folder in wwwroot







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 30 at 8:14

























                  answered Aug 30 at 8:02









                  mybirthname

                  15k32042




                  15k32042






















                      up vote
                      1
                      down vote













                      The answer by @mybirthname is great . Another way to do that is to use libman cli . We can use the following command to install the libman :



                      dotnet tool install --global Microsoft.Web.LibraryManager.Cli


                      And now you can install jquery , jquery-validation-unobtrusive and so on as you like :



                      to init a libman.json :



                      libman init 


                      to install a dependency of jquery-validation-unobtrusive:



                      > libman install jquery-validation-unobtrusive
                      Destination [libjquery-validation-unobtrusive]:
                      lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js written to disk
                      lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js written to disk
                      Installed library "jquery-validation-unobtrusive@3.2.10" to "libjquery-validation-unobtrusive"


                      to install a depenency of jquery:



                      > libman install jquery
                      Destination [libjquery]:
                      lib/jquery/core.js written to disk
                      lib/jquery/jquery.js written to disk
                      lib/jquery/jquery.min.js written to disk
                      lib/jquery/jquery.min.map written to disk
                      lib/jquery/jquery.slim.js written to disk
                      lib/jquery/jquery.slim.min.js written to disk
                      lib/jquery/jquery.slim.min.map written to disk
                      Installed library "jquery@3.3.1" to "libjquery"





                      share|improve this answer
























                        up vote
                        1
                        down vote













                        The answer by @mybirthname is great . Another way to do that is to use libman cli . We can use the following command to install the libman :



                        dotnet tool install --global Microsoft.Web.LibraryManager.Cli


                        And now you can install jquery , jquery-validation-unobtrusive and so on as you like :



                        to init a libman.json :



                        libman init 


                        to install a dependency of jquery-validation-unobtrusive:



                        > libman install jquery-validation-unobtrusive
                        Destination [libjquery-validation-unobtrusive]:
                        lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js written to disk
                        lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js written to disk
                        Installed library "jquery-validation-unobtrusive@3.2.10" to "libjquery-validation-unobtrusive"


                        to install a depenency of jquery:



                        > libman install jquery
                        Destination [libjquery]:
                        lib/jquery/core.js written to disk
                        lib/jquery/jquery.js written to disk
                        lib/jquery/jquery.min.js written to disk
                        lib/jquery/jquery.min.map written to disk
                        lib/jquery/jquery.slim.js written to disk
                        lib/jquery/jquery.slim.min.js written to disk
                        lib/jquery/jquery.slim.min.map written to disk
                        Installed library "jquery@3.3.1" to "libjquery"





                        share|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          The answer by @mybirthname is great . Another way to do that is to use libman cli . We can use the following command to install the libman :



                          dotnet tool install --global Microsoft.Web.LibraryManager.Cli


                          And now you can install jquery , jquery-validation-unobtrusive and so on as you like :



                          to init a libman.json :



                          libman init 


                          to install a dependency of jquery-validation-unobtrusive:



                          > libman install jquery-validation-unobtrusive
                          Destination [libjquery-validation-unobtrusive]:
                          lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js written to disk
                          lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js written to disk
                          Installed library "jquery-validation-unobtrusive@3.2.10" to "libjquery-validation-unobtrusive"


                          to install a depenency of jquery:



                          > libman install jquery
                          Destination [libjquery]:
                          lib/jquery/core.js written to disk
                          lib/jquery/jquery.js written to disk
                          lib/jquery/jquery.min.js written to disk
                          lib/jquery/jquery.min.map written to disk
                          lib/jquery/jquery.slim.js written to disk
                          lib/jquery/jquery.slim.min.js written to disk
                          lib/jquery/jquery.slim.min.map written to disk
                          Installed library "jquery@3.3.1" to "libjquery"





                          share|improve this answer












                          The answer by @mybirthname is great . Another way to do that is to use libman cli . We can use the following command to install the libman :



                          dotnet tool install --global Microsoft.Web.LibraryManager.Cli


                          And now you can install jquery , jquery-validation-unobtrusive and so on as you like :



                          to init a libman.json :



                          libman init 


                          to install a dependency of jquery-validation-unobtrusive:



                          > libman install jquery-validation-unobtrusive
                          Destination [libjquery-validation-unobtrusive]:
                          lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js written to disk
                          lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js written to disk
                          Installed library "jquery-validation-unobtrusive@3.2.10" to "libjquery-validation-unobtrusive"


                          to install a depenency of jquery:



                          > libman install jquery
                          Destination [libjquery]:
                          lib/jquery/core.js written to disk
                          lib/jquery/jquery.js written to disk
                          lib/jquery/jquery.min.js written to disk
                          lib/jquery/jquery.min.map written to disk
                          lib/jquery/jquery.slim.js written to disk
                          lib/jquery/jquery.slim.min.js written to disk
                          lib/jquery/jquery.slim.min.map written to disk
                          Installed library "jquery@3.3.1" to "libjquery"






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 30 at 8:51









                          itminus

                          5968




                          5968



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52091425%2fhow-do-i-use-microsoft-jquery-unobtrusive-ajax-with-libman-library-manager-asp%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              List of Gilmore Girls characters

                              What does second last employer means? [closed]

                              One-line joke