Introduction
This article shows how to select courses from a list. When we select the set of the courses from a list the current price of the courses is calculated.
We know that backbone.js is a JavaScript library. It gives a structure to the web application with the models, Views and collections. All of these are connected to the application with backbone through RESTful JSON interface. Backbone is for client-side applications so it stores everything on the client side.
Now we create an application for selecting courses and the current cost of the courses are shown depending on the number of courses selected..
- First we will create an application using the following:
- Start Visual Studio 2013.
- From the Start window select "New Project".
- Select "Installed" -> "Visual C#" -> "Web" -> "Visual Studio 2012" and select "ASP.NET Empty Web Application".

- Click on the "OK" button.
- Now add an HTML page to the project using the following:
- In the Solution Explorer.
- Right-click on the project select "Add" -> "HTML Page".

- Change the name of the page.

- Click on the "OK" button.
Add the following code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Your first Backbone.js App | Tutorialzine </title>
</head>
<body>
<form ><!--id="main" method="post">-->
<h1>My Courses</h1>
<ul id="courses">
<!-- The sCervices will be inserted here -->
</ul>
<p id="total">total: <span>$0</span></p>
</form>
<!-- JavaScript Includes -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
<script src="scripts/Hello.js"></script>
</body>
</html>
- Now add a scripting file to the project.
- In the Solution Explorer.
- Right-click on the project then select "Add" -> "New Folder" then name it "scripts".
- Add the Script file in this folder.
- Right-click on the scripts folder and then select "Add" -> "New Item" -> "JavaScript".

- Click on the "Add" button.
Add the following code:




Join the conversation! Your thoughts help the community grow.