Skip Navigation LinksHome > Categories > Code from a Category

How to add an RSS Feed to site



User Name: codelecturer
Name: Mike Chauhan
Contact Me: www.datawebcoder.com/ContactUs.aspx
Home Page: www.datawebcoder.com
6 years of total IT experience including programming, application development, System Maintenance . 3 years of Experienced and expertise in .Net Framework VB, Visual Basic.Net, ASP.Net 2.0, 3.5 and AD... [More]
Viewed Times: 1276
Add Date: 09/07/2012
In this article we will see how we can add an RSS Feed to your site
RSS feeds can be a useful way of letting your visitors see new content from your site. For example, I've added a couple on this site, one of which shows you a list of articles.

To create this on your site, add a new page entitled "rssfeed.aspx" and add this to the Page Load event:



As I mentioned above, you can see this in action here so to get a working example on your site, you'll need to:

Add the code that you use to connect to your database (in the section with the comment "Insert your code here to get the data").

Customise the sections where I have referenced my site and set the database fields in the "item element" loop.

Make sure you import the System.IO, System.Xml and System.Data classes.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.