This method will return a fragment of html markup with a roulette of AZ links in it. If there are no tasks in the current letter, it will simply show the letter without a link. I think you can easily change this into your MVC project.
private string GetAlphaRouletteLinksHtmlMarkup() { var JobList = new List<String>() { "AccessibleEmployment", "accessIndiana", "AccountingNet", "Alldiversity.com", "American Chemical Society", "America Job Bank", "Art Careers", "Asian MBA", "Back Door Jobs", "Career Search", "Careerbliss", "Careerbuilder", "CareerJet", "CareerMagazine", "CareerMosaic", "CareerOverview", "Careers 2005", "City of Evansville jobs", "College Recruiter", "CollegeGrad.com", "ComputerJobs", "Conservation Job Board", "Cuyahoga County Public Library", "Dentist Jobs Help", "EMPLOYMENTCROSSING", "Evansville Courier & Press Classifieds", "Exam2Jobs", "Experience.com", "Federal Government Jobs", "Flipdog", "FPSelectJobs", "hotjobs", "Hound", "Idealist", "Indeed", "Indiana Health Careers", "Indiana Job Central", "Indiana Youth Institute", "IndianaCAREERConnect", "Inside Jobs", "Internships", "Jackson County Industrial Development Corporation", "Jamminjobs", "Job Application Center", "Job Search USA", "Job Seeker Bookmarks", "Job-Applications", "JobCo", "Jobs in Indianapolis Web site", "JobScribble", "Journal of Young Investors", "Learn More Indiana", "Louisville, KY jobs", "Mediapost", "NBMBAA", "News-Line Communications", "On-Line Career Center", "Online Recruiters Directory", "PeaceCorps", "Quintessential Careers", "Riley Guide", "RiseSmart", "SallieMae True Careers", "ScienceJobs.com", "Simply Hired", "SmartBrief", "Snagajob.com", "State government job opportunities", "Student Employment Opportunities", "Teacher Jobs Help", "The Ladders Career Advice", "US Department of State", "USAJOBS", "wetfeet", "WomensJobSearch", "Work In Sports", "WorkplaceDiversity" }; var letters = from alpha in Enumerable.Range('A', 'Z' - 'A' + 1).Select(c => c.ToString()) let firstLetters = (from job in JobList orderby job group job by job[0].ToString().ToUpper() into firstLetters select firstLetters.Key) select new { Letter = alpha, IsLink = firstLetters.Contains(alpha) }; StringBuilder outputHtml = new StringBuilder(); foreach (var item in letters) { if (item.IsLink) {
All you have to do is combine this code and save your existing attempt, which displays a list of individual tasks.
Update - I improved by moving it to a single LINQ statement by clicking the first letters in a subsample. The output code is an updated version without a massive JobList :
Update 2 - I replaced the split line with another LINQ, which generates an uppercase letter in this snippet and merges the updates together.