Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
How to order a dropdown list items in revers direction?

I use the following code to read data from database and demonstrate them in a dropdown list:

@{
int m = 1;
foreach (var item in Model.MessagesList)
{
    if (@item.receiverUserId == userId)
    {
        <li>
            <a class="dropdown-item message-item" asp-controller="Messages" asp-action="Index" id="msg-@m"> @Model.UsersList.Where(x => x.Id == item.senderId).Select(x => x.department).First()</a>
        </li>
        m++;
    }
}

}

I want to revers the order of items. What is the best method?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

if its coming from a DB why not just use Order By?

select val from table ORDER BY val DESC (or ASC)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!