I am passing a list to the view from Controller. How can i generate the following type of HTML by using the Model passed…….
.
I tried using the following code, but it generates a vertical list whereas i want it to be horizontal as well as vertical. Here’s my code. How will you write your’s to achieve an output like above
@foreach (var cats in Model)
{
<li>@cats.CategoryName</li>
}
You need to combine this mark-up with some css:
Then the CSS: