title: How to implement Lightbox for MVC?
body: <p>I'm trying to implement lightbox in my MVC solution. I've downloaded the package from NuGet repository and I'm not able to get this running in my solution.</p>
  
  <p>I've added in the BundleConfig this code:</p>
  
  <pre><code>bundles.Add(new ScriptBundle("~/bundles/lightbox").Include(
                      "~/Scripts/lightbox-2.6.min.js"));
  </code></pre>
  
  <p>In _layout.cshtml I've added the line:</p>
  
  <pre><code>@Scripts.Render("~/bundles/lightbox")
  </code></pre>
  
  <p>Then, in a view that I want to show lightbox I have added:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function () {
      $("#gallery a").lightBox();
  });
  </code></pre>
  
  <p></p>
  
  <p>And finally, I've added these lines to show lightbox in my image gallery:</p>
  
  <pre><code>&lt;div id="gallery"&gt;
  @foreach (var image in Model.Images)
  {
      &lt;a href="@Url.Content(ViewBag.Path + image.filename)"&gt;
          &lt;img src="@Url.Action("Thumbnail", "Ad", new { width = 150, height = 150, filename = @image.filename})" alt="@image.filename" /&gt;
      &lt;/a&gt;
  }
  &lt;/div&gt;
  </code></pre>
  
  <p>But with these lines I can't show images with lightbox. They are opened in the browser as a normal image.</p>
  
  <p>Any suggestion about this issue would be appreciated.</p>
  
  <p>Thank you in advanced.</p>