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 8324081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:55:40+00:00 2026-06-08T23:55:40+00:00

I am working with MVC 3, Razor and Entity Framework. I am making a

  • 0

I am working with MVC 3, Razor and Entity Framework. I am making a blog using MVC 3, so on the blog there are many posts. On the homepage I am showing for now say 10 posts.

I am using the following code to display posts.

 <h1 class="postTitle">@Html.ActionLink(post.PostTitle, "SinglePost", "Post", new { postID = post.PostID}, null)</h1>

 <div class="postDateTime"><b>Posted on :</b> @post.PostDateTime</div>
 <br/>
 @if(post.PostContent.Length > 500)
 {
     <span>@post.PostContent.Substring(0, 500) [Read More...]</span>
 }
 else
 {
     <span>@post.PostContent</span>
 }

 <hr class="postSeparator"/>
 </div>

I am a little confused as to how to implement paging for this, or better something like this implemented at SO.
Please guide me on this fellas.

enter image description here

  • 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-08T23:55:42+00:00Added an answer on June 8, 2026 at 11:55 pm

    The key point is to use Skip() and Take() LINQ methods when querying your model:

    EG

    int page;
    int pageSize;
    var postsToDisplay =db.Posts.Where(x => x.Tag == "EF")
                                .Skip((page -1) * pageSize)
                                .Take(pageSize);
    

    You should place this in a ViewModel, and then use View which is strongly typed to your ViewModel.

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

Sidebar

Related Questions

I am making a Blog using MVC 3, Razor and Entity Framework. I am
I am working on mvc project, with repository pattern and entity framework, now on
I am working on project using MVC 3.0(Razor framework). I am trying to get
I am working on creating a blog with ASP.Net 4, MVC 3, Razor and
The DataAnnotations validator not working in asp.net mvc 4 razor view, when using the
FYI, I'm working on my first MVC web application using MVC 3 and Razor
I am working on my first ASP.Net MVC Application . I am using Razor
I am working in ASP.NET MVC 3 application, I am using razor view. I
I'm using MVC 3 with Razor and using unobtrusive client validation. Things are working
I am working on a website in ASP .NET MVC 3 using Razor and

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.