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

  • SEARCH
  • Home
  • 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 8603017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:13:32+00:00 2026-06-12T02:13:32+00:00

I would like to only display 2 results on my partial view with a

  • 0

I would like to only display 2 results on my partial view with a show more link displayed if there are more results. My query which will display all results is:

[ChildActionOnly]
public ActionResult GetContacts(int id)
{
    var contacts = from c in db.CustomerContact
                   where c.CustomerID == id
                   orderby c.Surname
                   select c;

    return PartialView("_GetContacts", contacts);
}

Do I need to have two queries, one to count the number of results?

Would like to use jquery to show more results by expanding div.

If anyone could point me in the right direction it would be appreciated.

  • 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-06-12T02:13:33+00:00Added an answer on June 12, 2026 at 2:13 am

    Depending on the quantity of elements that your query usually returns it would be a good idea to use a query to retrieve just two elements and use a different query to show the rest of elements when your users ask for it.

    To avoid loading all your results always you can use an AJAX call to server on the link to show more.

    However, if your query usually returns few elements you can use just one query to load all of them and show two or more through show more link click.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i would like to display results for values that are only 10 and over
I'm working with a Facebook Canvas App and I would like to only display
I would like to display only posts that are members of BOTH category 33,
I would like to display a line of text only if an object called
I have a simple LINQ query. I would like to only check the DateDisable
I have a searchable tableview, but would like to only display the number of
How do I select only the first 10 results of a query? I would
I would like to create a sql query that returns results together for 2
I would like to display a large number of results without multiple pages to
I would like the autocomplete to display a footer which says Displaying top 5

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.