Getting Started with Bower on an ASP.NET MVC project
ASP.NET MVC is the server-side world.Server-side means the code is executed by the server and results rendered to the front-end which is also known as client-side.
Bower is front-end package manager.Manages installations and updates to newer versions.
To check if all these three variables are installed in your PC,Open the command prompt and enter below commands.
Results should look like below screenshot.
Once you have everything working fine.It’s time to install bower.
The “-g ” means that bower will be installed globally i.e it will be downloaded from npm servers.
How to use bower in a project
Create a folder and name it <bower-test>.Open command prompt.
Open< bower-test> folder using cd bower-test command.
Then initialize bower in the project folder by typing bower init command.See below screenshots.
You don’t have to worry much about the answers that you enter.You can change these values later.my bower.JSON file looks like this.
“description”: “just testing out bower”,
How to find and Install Packages with bower
There are two ways of searching packages.You can either use or visit Bower website or command line
will return below results.
After searching the package,you need to install it.As you can see above there are several options to choose from.let’s install jquery-file-upload.
Now checking bower.json file on bower-components folder.Below code has been added.
How to install bower package using Visual studio
To install packages from visual studio,first, you need to set up some tools that are needed. Once you have the tools set,open bower.json file in visual studio.Start typing and below is what I get on my side.
Once you have added the package in json file,From visual studio install the package
or using command Prompt.
Anything in json file will be installed.
How to Manage Bower Packages
Command to list packages is <bower list>
Command to update bower packages is <bower update>
3.Uninstall certain package
To uninstall certain bower package command is <bower uninstall jquery-file-upload>
How to use Bower in an ASP.NET MVC app
Below is a modified stock MVC template that use
Don’t forget to leaver a comment and share this article please.