Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 819137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:15:37+00:00 2026-05-15T02:15:37+00:00

I’m a complete C# AND MVC noob, so this one’s been a bitter struggle

  • 0

I’m a complete C# AND MVC noob, so this one’s been a bitter struggle for me.

I’ve done a horrible but ultimately successful job of building a website for work to display the results of the impending primary/local elections.

What I need in the final view of my site is to display all the results of races in the same category. For example, there are three city commission positions open, and I need results for all three races on one page. I can display all the results I want, filtered by category, and in the pretty css table, what I can’t seem to figure out is how I split that table up with sub headings for each of the individual races.

The data is direct Linq to SQL and comes out of a single view on the server (repositories are a thing that will have to happen in my next project unless they are essential to this function).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:15:38+00:00Added an answer on May 15, 2026 at 2:15 am

    I’m not quite sure if this is what you are after, do let me know and I’ll try to help.

    This won’t work directly for you, but hopefully might point you in the right way. I’m currently using a custom view model to hold this data, which I’m actually thinking of moving away from as my system is getting very complicated, but it might help you.

    I can explain what that means if you need me to, (I was a noob just a year ago!)

    I have assumed that you want races grouped by category.

     <% foreach (var group in Model.GroupBy(item => item.categoryId)) Gives you the inital sort
     { %>
    <% foreach (var item in group.Take(1))
    { //Category %>
    <%=Html.Encode(item.CategoryName) %>
    <% } %>
    
    <% foreach (var item in group)
    { //Indervidual races%>
    
    <%=Html.Encode(item.raceResult) %>
    <% } %>
    
    
    <% foreach (var item in group.Take(1))
    { %>
    <!-- Area which happens after each category grouping -->
    <% } %>
    <% } %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.