Reputation: 183
<ul class="related_forms_list">
@foreach (var year in test.years ?? new List<YearsVM>())
{
<li><a href="@Url.Action("Test","Link", new { id=Year.Id })">@Year.Year</a></li>
}
My code above pulls a list of years that is gathered from my database. However, they aren't organized by year. I was thinking Javascript would be the best way to do this but I am unsure of how to write the javascript so it affects my list.
Upvotes: 2
Views: 164