Skip to content

Instantly share code, notes, and snippets.

@ps-team
Created April 7, 2015 13:47
Show Gist options
  • Save ps-team/0008dc6f6a5076c3bc1e to your computer and use it in GitHub Desktop.
Save ps-team/0008dc6f6a5076c3bc1e to your computer and use it in GitHub Desktop.
<nav class="atozNavigation">
@for(char c = 'A'; c <= 'Z'; c++) {
var hasContentTest = from content in allContent where content.Data.Title.ToString().StartsWith(c.ToString()) select content;
if (hasContentTest.Count() > 0) {
if(c.ToString() == currentLetter) {
<a class="currentLetter" title="See content starting with @c" href="AtoZ.aspx?letter=@c">@c</a>
} else{
<a href="AtoZ.aspx?letter=@c" title="See content starting with @c">@c</a>
}
} else {
<span class="noContent">@c</span>
}
}
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment