i am working on my **MVCOnlineShop** , this what i made so far:
[![Image](https://i.stack.imgur.com/IRY1W.png)](https://i.stack.imgur.com/IRY1W.png)
i wrote a code before in a `View` so i can link the products to their category and it worked , all categories and products database are in an `SQL server`. this is the code:

```
@model MVCOnlineShop.Models.Category

@{
    ViewBag.Title = "Browse";
}
<h2>Browsing Category: @Model.CategoryName</h2>
<ul>
    @foreach (var Product in Model.Products)
    {
        <li>
            @Html.ActionLink(Product.ProductName,
"Details", new { id = Product.CategoryID })
        </li>
    }
</ul>

```

**Question:** Now how can i use this code to show products under their category in a `bootstrap` drop down list? so i want to **click** or **hover** on games for example and i want to get a drop down list that have game 1, game 2, game 3. thanks! and this is what i tried in my `_Layout.cshtml`:

```
@using MVCOnlineShop.Models;

@{
    // stores the Session content in a var
    var Categories = Session["Categories"] as List<Category>;
}

@*Checks if the Session variable is correct*@
@if (Categories != null)
{
    <ul class="nav navbar-nav">
        @*For each category in the Session var, display the link*@

            @foreach (var Category in Categories)
            {
                <div class="dropdown">
                    <button class="dropbtn">@Html.ActionLink(Category.CategoryName, "Browse", new { Category = Category.CategoryName })</button>
                <div class="dropdown-content">
    <a href="#">Link 1</a>
    <a href="#">Link 2</a>
    <a href="#">Link 3</a>
  </div>
</div>

            }

</ul>
}

```

and this is the category class from `SQL`, `Category.cs`:

```
namespace MVCOnlineShop.Models
{
    using System;
    using System.Collections.Generic;

    public partial class Category
    {
        public Category()
        {
            this.Products = new HashSet<Product>();
        }

        public int CategoryID { get; set; }
        public string CategoryName { get; set; }
        public string Description { get; set; }

        public virtual ICollection<Product> Products { get; set; }
    }
}

```