...

View Full Version : asp.net rss feed



schristy
03-05-2011, 03:09 AM
I want to create an rss feed off of a page that is generated by asp.net vb content. In otherwords, everytime someone posts a new record (a new job listing) to the asp.net dbase, the page shows the most recent update (latest job posted) and I want people to be able to subscribe to receive updates via an RSS feed.

I've searched the web and found some info but nothing has really made much sense. I've found lots of things that manually create feeds when an html page is saved with updates but I need something that automatically produces a new feed each time the information in my asp.net dataset changes.

Does anyone have any suggestions where I may find information on doing something like this?

drhow
03-24-2011, 09:41 PM
i hope this link is useful for you
asp.net library

http://www.myaspnet.com/images/mylogo.gif (http://www.myaspnet.com)


http://www.myaspnet.com


drhow

drhow
03-24-2011, 09:42 PM
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Clear()
Response.ContentType = "text/xml"
Dim objX As New XmlTextWriter(Response.OutputStream, Encoding.UTF8)
objX.WriteStartDocument()
objX.WriteStartElement("rss")
objX.WriteAttributeString("version", "2.0")
objX.WriteStartElement("channel")
objX.WriteElementString("title", "آخر أخبار فعاليات النادي السعودي في مدينة ريجاينا")
objX.WriteElementString("link", "http://localhost:50081/Default.aspx")
objX.WriteElementString("description", "آخبار أنشطة النادي ")
objX.WriteElementString("copyright", "جميع الحقوق محفوظه لدى النادي السعودي في مدينة ريجاينا 2010 ")
objX.WriteElementString("ttl", "5")
Dim myconn As New SqlConnection(ConfigurationManager.ConnectionStrings("conn").ConnectionString)
myconn.Open()
Dim objCommand As New SqlCommand("SELECT id, nesubject, nemessage from news", myconn)
Dim rd As SqlDataReader = objCommand.ExecuteReader()
While rd.Read()
Dim str As String = Replace(rd.GetString(1), " ", "")
objX.WriteStartElement("item")
objX.WriteElementString("title", str)
Dim newDetails As String = ""
If (rd.GetString(2).ToString.Length >= 500) Then
newDetails = rd.GetString(2).ToString.Substring(0, 500)
Else
newDetails = rd.GetString(2).ToString
End If
objX.WriteElementString("description", newDetails)
objX.WriteElementString("link", "http://localhost:50081/clubnews.aspx?ID=" + rd.GetInt32(0).ToString())
objX.WriteElementString("pubDate", GetTodaydate)
objX.WriteEndElement()
End While
rd.Close()
myconn.Close()

objX.WriteEndElement()
objX.WriteEndElement()
objX.WriteEndDocument()
objX.Flush()
objX.Close()
Response.End()

End Sub


http://www.myaspnet.com/images/mylogo.gif (http://www.myaspnet.com)

http://www.myaspnet.com/codedisplay.aspx?id=421

Theah
03-28-2011, 04:51 PM
I ran into this same problem in C# with ASP.Net.

When I found the solution, I decided to create an open source project that allows people to easily do this. I don't know VB, but I know .Net projects are compatible and you should be able to use it.

There are a lot of extensions to the RSS specification that you can use.. like copyright, managingEditor, webMaster, etc. The project will handle all of these and show you which ones you can use.

Dynamic RSS and Sitemap (http://sourceforge.net/projects/seodynamicxmlne/) project

This is a link to the open source project. I didn't link my blog or anything because I didn't want to appear self promoting. I don't get anything out of linking the open source project.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum