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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:50:17+00:00 2026-05-10T23:50:17+00:00

I’ve seen a few examples of RSS Feeds in ASP.NET MVC, like this ,

  • 0

I’ve seen a few examples of RSS Feeds in ASP.NET MVC, like this, and some samples in projects (like Oxite), but none of them are complete.

Eg. None of them check for the header

  If-Modified-Since 

in the request, to save bandwidth.

I do not want to reinvent the wheel, so I stop here asking for some directions.

  • 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. 2026-05-10T23:50:18+00:00Added an answer on May 10, 2026 at 11:50 pm

    I ended up with this. Please comment or edit the post if you find any error or better way to do it.

    RssController

    Imports System.ServiceModel.Syndication Imports System.Xml Imports System.Web.HttpContext  Function MasterRSS()     Dim baseURL As String = 'http://www.mysite.com'     Dim feed As New SyndicationFeed('MySite - Master RSS', '', New Uri(baseURL))     ''//Add a custom attribute.     Dim xqName As New XmlQualifiedName('CustomAttribute')     feed.AttributeExtensions.Add(xqName, 'Value')      Dim sp As New SyndicationPerson('jerry@mysite.com', 'Jerry Seinfeld', 'http://Jerry.blog.com')     feed.Authors.Add(sp)      Dim category As New SyndicationCategory('Category')     feed.Categories.Add(category)      feed.Contributors.Add(New SyndicationPerson('cosmo@mysite.com', 'Cosmo Kramer', 'http://kramer.blog.com'))     feed.Copyright = New TextSyndicationContent('MySite 2008')     feed.Description = New TextSyndicationContent('My description')      ''//Add a custom element.     Dim doc As New XmlDocument()     Dim feedElement As XmlElement = doc.CreateElement('CustomElement')     feedElement.InnerText = 'Some text'     feed.ElementExtensions.Add(feedElement)      feed.Generator = 'Custom'     feed.Id = 'MySiteFeedID'     feed.ImageUrl = New Uri('http://www.mysite.com/content/images/logo.png')      ''//Items     Dim ModifiedSince As Date     If Not Date.TryParse(Current.Request.Headers('If-Modified-Since'), ModifiedSince) Then         ModifiedSince = Date.Today.AddDays(-30) ''//Or whatever make sense to you.              Else         ModifiedSince.AddMinutes(-5) ''//Just in case, we do not want to miss any item.      End If      ''//the list of items.     Dim items As New List(Of SyndicationItem)()       Dim db As New mainDataContext     Dim textContent As TextSyndicationContent, Item As SyndicationItem      ''//Then send the list of post, comments, whatever.     Dim Posts = (From p In db.Posts Where c.Date >= ModifiedSince Order By p.Date Descending)     For Each Post In Posts         Dim sb As New StringBuilder         sb.AppendFormat('<p>{0}</p>', Post.FullText)         textContent = New TextSyndicationContent(sb.ToString, TextSyndicationContentKind.Html)         Item = New SyndicationItem('Post ' + Post.PostID.ToString, textContent, New Uri(baseURL + '/Post/View/' + Post.PostID.ToString), 'Post' + Post.PostID.ToString, Post.Date)         items.Add(Item)     Next       If items.Count = 0 Then         ''//send a 304 to the browser.         Return View('304')     End If      feed.Items = items     feed.Language = 'es-ar'     feed.LastUpdatedTime = (From i In items Select i.LastUpdatedTime Order By LastUpdatedTime Descending).FirstOrDefault      ''//Not needed in this sample.     ''//Dim link As New SyndicationLink(New Uri('http://server/link'), 'alternate', 'Link Title', 'text/html', 1000)     ''//feed.Links.Add(link)      ViewData('feed') = feed     Return View('Rss')  End Function 

    Rss View (rss.aspx)

    Dim htmlwriter As System.IO.Stream = Response.OutputStream Dim rssWriter As System.Xml.XmlWriter = System.Xml.XmlWriter.Create(htmlwriter) Dim feed As System.ServiceModel.Syndication.SyndicationFeed = ViewData('feed') Dim rssFormatter As New System.ServiceModel.Syndication.Rss20FeedFormatter(feed) rssFormatter.WriteTo(rssWriter) rssWriter.Close() 

    This way, you can reuse the view

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

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into

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.