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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:44:32+00:00 2026-05-27T06:44:32+00:00

I am stuck on how to implment paging when retrieving images from my rss

  • 0

I am stuck on how to implment paging when retrieving images from my rss feed. I have a helper also to render the html for the pager links. However i am not sure what to do in the Index action. My code is as follows:

In my controller:

Public Function Index() As ActionResult
        Dim feedurl As String = "http://riderdesign.net/p290530166/recent.rss"
        Using x = XmlReader.Create(feedurl)
            Dim r = XDocument.Load(x)
            Dim mediapfx As XNamespace = "http://search.yahoo.com/mrss/"
            '  Dim rssfeed = SyndicationFeed.Load(x)
            Dim ml = From item In r.Descendants(mediapfx + "content") Select item
            Dim PageSize As Integer = Configuration.ConfigurationManager.AppSettings.Get("PageSize")

            Dim medialist = From item In r.Descendants("item") Select New MediaImage With {
             .Alt = item.Element("title"), .ImageUrl = item.Element("link"), .ThumbnailUrl = TryGetAttributeValue(item.Element(mediapfx + "thumbnail"), "url"), .Height = TryGetAttributeValue(item.Element(mediapfx + "thumbnail"), "height"), .Width = TryGetAttributeValue(item.Element(mediapfx + "thumbnail"), "width")} Take PageSize
            Return View(medialist)

        End Using

    End Function

PagedData class:

    Public Class PagedData
    Public Property TotalItems As Integer

    Public Property ItemsPerPage As Integer

    Public Property CurrentPage As Integer

    ReadOnly Property TotalPages As Integer
        Get
            Return Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(TotalItems / ItemsPerPage)))
        End Get
    End Property

End Class

And my paging view model

 mvcPublic Class PagingViewModel
    Property Images As IEnumerable(Of MediaImage)
    Property Paging As Pager

End Class

Paging helper:

   Public Class PagingHelper
    Public Shared Function PageLinks(ByVal html As HtmlHelper, ByVal Page As Pager, ByVal pageUrl As Func(Of Integer, String)) As MvcHtmlString
        Dim r As StringBuilder = New StringBuilder
        For i = 1 To Page.TotalPages
            Dim tag As TagBuilder = New TagBuilder("a")
            tag.MergeAttribute("href", pageUrl(i))
            tag.InnerHtml = i.ToString
            If i = Page.CurrentPage Then
                tag.AddCssClass("selected")
                r.Append(tag.ToString)

            End If
            Return MvcHtmlString.Create(r.ToString)
        Next

    End 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-27T06:44:33+00:00Added an answer on May 27, 2026 at 6:44 am

    I implemented paging using Troy Goode’s PagedList and its associated helper. I call the ToPagedList extension method and use the helper to render the links for paging. I did download the souce for the helper and modify it however to render spans instead of an unordered list for the paging links.

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

Sidebar

Related Questions

I'm stuck trying to implement a single server queue. I've adapted some pseudocode from
I have a client who wants to return an ENORMOUS query from a web
I am stuck on the following issue: I have a model with a property
I have a really simple request, but I'm stuck on how to implement the
I'm kind of like stuck trying to implement YUI autocomplete textbox. here's the code:
I kind of stuck on how to implement this query - this is pretty
I'm trying to implement exception handling for an embedded OS and I'm stuck at
I'm learning some OpenGL game programing, and I'm stuck in how to implement so
If I were to implement a web application from scratch today, which app stack
Being stuck with a legacy database schema that no longer reflects your data model

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.