You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have more the 4 posts the home page should show a summary of the latest four and display a previous button so that the user can navigate to the earlier posts (assuming of course that your appsettings.json has blog:postsPerPage=4). Unfortunately, the previous button doesn't appear.
There seems to be a bug in views\blog\index.cshtml
@{
int currentPage = int.Parse(ViewContext.RouteData.Values[Constants.page] as string ?? "0");
int pageCount;
pageCount = int.TryParse(ViewData[Constants.TotalPostCount].ToString(), out pageCount) ? 0 : pageCount / 2;
}
When int.TryParse() succeeds pageCount is zero, and when it fails pageCount is zero/2. Therefore I propose the following fix:
Add to Constants.cs
public static readonly string PostsPerPage = "PostsPerPage";
Update BlogController.Index() and BlogController.Category()
When you have more the 4 posts the home page should show a summary of the latest four and display a previous button so that the user can navigate to the earlier posts (assuming of course that your appsettings.json has blog:postsPerPage=4). Unfortunately, the previous button doesn't appear.
There seems to be a bug in views\blog\index.cshtml
When int.TryParse() succeeds pageCount is zero, and when it fails pageCount is zero/2. Therefore I propose the following fix:
The text was updated successfully, but these errors were encountered: