Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RSS Feeds

Status
Not open for further replies.

dashusa

Programmer
Mar 27, 2006
46
US
Hello not sure if this is the right plsce to ask this but ...
I need a RSS feed in my page and i am not sure how to do this
I have down loaded a news aggregator and have added some sites to it and it displays the feed well and updates and all BUT i dont know how to get it onto my site ..
If i copy the code from the news aggregator and paste it into a html page i get the same as the aggregator but i dont think its updating...How do i make a feed that auto updates?
PLEASE help Thanks D
 
Create a Data Control and use the feed as the source, as illusrated below.

Code:
    private void Page_Load(object sender, System.EventArgs e)
    {
        // Put user code to initialize the page here


        posts.DataSource = GetRSSFeed("[URL unfurl="true"]http://www.newsrecord.org/articles.rss");[/URL]
        posts.DataBind();

    }
    private DataTable GetRSSFeed(string strURL)
    {
        XmlTextReader reader = new XmlTextReader(strURL);
        DataSet ds = new DataSet();
        ds.ReadXml(reader);

        return ds.Tables[2];

    }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top