title: ASP.NET MVC 4 issues with including external javascript
body: <p>I'm new in MVC and i got stuck with using a downloaded javascript controller in a partial view. I downloaded this treeview:<br>
  <a href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/" rel="nofollow noreferrer">http://bassistance.de/jquery-plugins/jquery-plugin-treeview/</a> <br>
  Then I placed the treeview.js and demo.js scripts in the project, with the css and the images folder. The 2 .js files are in the /Scripts/treeview folder and the css and images folder is in the /Content folder.
  <br><br>
  I added these to my BundleConfig.cs: <br></p>
  
  <pre><code>        bundles.Add(new ScriptBundle("~/bundles/treeview").Include(
                      "~/Scripts/treeview/jquery.treeview.js",
                      "~/Scripts/treeview/demo.js"));
  
          bundles.Add(new StyleBundle("~/Content/css/treewiew").Include("~/Content/jquery.treeview.css"));
  </code></pre>
  
  <p>My partial view looks like this: <br></p>
  
  <pre><code>&lt;ul id="browser" class="treeview"&gt;
      &lt;li&gt;&lt;span class="folder"&gt;Folder 1&lt;/span&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;span class="file"&gt;Item 1.1&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;span class="folder"&gt;Folder 2&lt;/span&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;span class="folder"&gt;Subfolder 2.1&lt;/span&gt;
                  &lt;ul id="folder21"&gt;
                      &lt;li&gt;&lt;span class="file"&gt;File 2.1.1&lt;/span&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;span class="file"&gt;File 2.1.2&lt;/span&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;&lt;span class="file"&gt;File 2.2&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li class="closed"&gt;&lt;span class="folder"&gt;Folder 3 (closed at start)&lt;/span&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;span class="file"&gt;File 3.1&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;span class="file"&gt;File 4&lt;/span&gt;&lt;/li&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the _Layout.cshtml I added these 2 lines in the head section, just before the @Styles.Render("~/Content/css") and @Scripts.Render("~/bundles/modernizr") lines:<br></p>
  
  <pre><code>&lt;link href="@Url.Content("~/Content/jquery.treeview.css")" rel="stylesheet" type="text/css" /&gt;
  &lt;script runat="server" type="text/javascript" src="@Url.Content("~/Scripts/treeview/jquery.treeview.js")"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And lastly, I call the partial view in the Index view, which is generated automatically with the project. The css works almost fine, I've got the styled list, but it doesn't functional as a tree view controller.</p>
  
  <p>Now, I found these posts, but these weren't able to help me:<br>
  <a href="https://stackoverflow.com/questions/12932544/how-to-include-javascript-code-in-asp-net-mvc4-view-page">How to include javascript code in asp.net MVC4 View page?</a> <br>
  <a href="https://stackoverflow.com/questions/11257940/mvc4-partial-view-javascript-bundling-issue">MVC4 partial view javascript bundling Issue</a> <br></p>
  
  <p>I just can't see what's the problem at me. I've just started to learn javascript recently, MVC was totally new and unknown to me 5 days before, and I stuck with this problem for 3 days now and I'm angry at myself for that. Please, help me! Thanks a lot!</p>