Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    asp.net rss feed

    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?

  • #2
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    asp.net library

    i hope this link is useful for you
    asp.net library




    http://www.myaspnet.com


    drhow

  • #3
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
     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/codedisplay.aspx?id=421

  • #4
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •