How To Create RSS Feed Using ASP - Net - RSS Feed Sample Using ASP - Net - ASP - Net, C#.NET, VB

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

12/22/13

how to Create RSS feed Using Asp.net | RSS Feed Sample using asp.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSR
Like 9.6k Follow @aspdotnetsuresh 3,090 follow ers

ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL HOME ASP.NET AJAX GRIDVIEW JAVASCRIPT SQL JQUERY OOPS CONCEPTS INTERVIEW QUESTIONS Server,Ajax,SSRS, XML examples
aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview how to Create RSS feedarticles,code Using Asp.net examples of asp.net 2.0 /3.5,AJAX,SQL Server asp.net Articles,examples of .net technologies
By: Suresh Dasari Apr 3, 2010 Categories: Asp.net , General , RSSFeeds

TRACE MOBILE NUMBER

ADVERTISE

| RSS Feed Sample using

Search This Site

Search

Introduction: Here I will explain how to create RSS feed using asp.net. Description: RSS stands for "Really Simple Syndication". RSS solves a problem for people who regularly use the web. It allows you to easily stay informed by retrieving the latest content from the sites you are interested in. You save time by not needing to visit each site individually. To implement RSS feed concept using asp.net just follow below steps Step 1: Create Table In tblRss SQl Server as below. ColumnName ID Title Description Url DataType int varchar(50) varchar(50) Varchar(50)

About Me
SURESH DA SA RI TENA LI, A NDHRA PRA DESH, INDIA

Step 2: Insert the Data In to the tblRss some Dummy data Url must be related Rss Link just like this ID 1 2 Title Test aspdotnet Description testing aspdotnet-suresh Url http://aspdotnet-suresh.com http://aspdotnet-suresh.com Aspdotnetsuresh
Like

Hi i am suresh dasari,software engineer working on asp.net,c#.net,SQL Server.


VIEW MY COMPLETE PROFILE

Step 3: In Default.aspx page add these 2 lines of code.

Follow @aspdotnetsuresh Like 9.6k

3,090 follow ers

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ OutputCache Duration="120" VaryByParam="*" %> Step4: In code behind
9,625 people like Aspdotnetsuresh.

Sorry, something went wrong.


1
Tw eet

using using using using using using using using using

System; System.Data; System.Data.SqlClient; System.Text; System.Web; System.Web.Security; System.Web.UI; System.Web.UI.WebControls; System.Xml;

Select Language
Facebook social plugin

Pow ered by

Translate

Share

public partial class GridviewEditUpdate : System.Web.UI.Page

{ StumbleUpon protected void Page_Load(object sender, EventArgs e) 1

{ string connectionString = "Data Source=MYCBJ017550027;Initial Catalog=MySamplesDB;Integrated Security=True"; DataTable dt = new DataTable(); SqlConnection conn = new SqlConnection(connectionString); using (conn) { SqlDataAdapter ad = new SqlDataAdapter("SELECT * from tblRSS", conn); ad.Fill(dt); }

Book Your Air Ticket


Round Trip Leaving From:
---------------

One Way Going To:


---------------

Passengers:
1

Depart Date:
22 Dec 2013

Return Date:
22 Dec 2013

*Conditions apply

www.aspdotnet-suresh.com/2010/04/creating-rss-feed-using-aspnet-with-c.html#more

1/6

12/22/13

how to Create RSS feed Using Asp.net | RSS Feed Sample using asp.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSR
Response.Clear(); Response.ContentType = "text/xml"; XmlTextWriter TextWriter = new XmlTextWriter(Response.OutputStream, Encoding.UTF8); TextWriter.WriteStartDocument(); //Below tags are mandatory rss TextWriter.WriteStartElement("rss"); TextWriter.WriteAttributeString("version", "2.0"); // Channel tag will contain RSS feed details TextWriter.WriteStartElement("channel"); TextWriter.WriteElementString("title", "C#.NET,ASP.NET Samples and Tutorials"); TextWriter.WriteElementString("link", "http://aspdotnet-suresh.blogspot.com"); TextWriter.WriteElementString("description", "Free ASP.NET articles,C#.NET,ASP.NET tutorials and Examples,Ajax,SQL Server,Javascript,XML,GridView Articles and code examples -- by Suresh Dasari"); TextWriter.WriteElementString("copyright", "Copyright 2009 - 2010 aspdontnet-suresh.blogspot.com. All rights reserved."); foreach (DataRow oFeedItem in dt.Rows) { TextWriter.WriteStartElement("item"); TextWriter.WriteElementString("title", oFeedItem["Title"].ToString()); TextWriter.WriteElementString("description", oFeedItem["Description"].ToString()); TextWriter.WriteElementString("link", oFeedItem["URL"].ToString()); TextWriter.WriteEndElement(); } TextWriter.WriteEndElement(); TextWriter.WriteEndElement(); TextWriter.WriteEndDocument(); TextWriter.Flush(); TextWriter.Close(); Response.End(); } }

Recent Posts
jQuery Set Maxlength for Multiline Textbox in Asp.net More jQuery Set Maximum Length to Textarea or jQuery Check Textar... More Call WCF Service from jQuery Ajax JSON Example in Asp.net us... More jQuery Slide DIV Content from Left to Right or Move DIV from... More jQuery Ajax JSON Example in Asp.net More SQL Server - Query to Get List of Tables in Database in SQL ... More Get Table Size in SQL Server | Query to Get Table Size in SQ... More SQL Server - How to Get Database Size in SQL Server 2008 More what is authorization in asp.net | authorization rules in we... More C# - Difference between String and Stringbuilder in C#, Asp.... More

Demo

Get Latest articles in your inbox for free.


Enter your email address:

Subscribe

If you enjoyed this post, please support the blog below. It's FREE!
Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

Like

9.6k

Subscribe by RSS
3,090 follow ers

Subscribe by Email

Follow @aspdotnetsuresh

Aspdotnet-Suresh
Follow
+ 1,550

+1

www.aspdotnet-suresh.com/2010/04/creating-rss-feed-using-aspnet-with-c.html#more

2/6

12/22/13

how to Create RSS feed Using Asp.net | RSS Feed Sample using asp.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSR
Find us on Facebook

Aspdotnetsuresh

Book Your Air Ticket


Round Trip Leaving from:
---------------

Like

One Way Going to:


---------------

9,625 people like Aspdotnetsuresh.

Passengers:
1

Depart Date:
22 Dec 2013

Return Date:
22 Dec 2013
Facebook social plugin

*Conditions apply

Tags
You might also like:

Asp.net

General

JQuery

Snippets Javascript C#.Net SQL Server Gridview VB.NET JQuery Plugins Interview Questions Errors Ajax DropdownList validations
DatePicker Authentication Fileupload SharePoint Membership OOPS Concepts JSON CSS Google API IISServer CheckBox Crystal Reports Google MAPS AutoComplete SendMail ExcelSheet InternetTips
Create Sim ple jQuery JQuery lightbox Mobile Website im age slideshow Exam ple gallery in asp.net How to Create a Site in SharePoint 2010 | Create ... jQuery Wiki Plugin to Show Wikipedia Description in ... Asp.net host w ebsite on local m achine w ith custom ... AjaxModalPopupExtender ExportGridview Data Menu Joins SlideShow WCF Window s Application XML Modalpopup WebService CheckBoxList Dynamic Controls Facebook Global.asax Tw itter Window s Service YouTube jQuery Menu jQuery UI Accordion Menu AjaxAsyncFileUpload EncryptionandDecryption
Degree View

LightBoxEffect

Polymorphism

Progressbar Visual Studio ZIP UNZIP Files w eb.config


Plugins AjaxAutoCompleteExtender AjaxTabContainer Average rating Blog Statistics Cookie Header on Scroll Flip Effect KeyBoard Key Codes MultilineTextbox News Ticker in jQuery PDF Viewers Session Timeout ThumbnailsGeneration UserName Visitors Count jQuery Cookie jQuery Media Plugins Image 3-TierArchitecture Advertise ADO.NET Ajax AbstractVsInterface AjaxAccordionControl AjaxCollapsiblePanelControl AjaxPasswordStrength Chatting Plugins CodingStandards ActiveDirectory Calendarextender Check

SQL Server - Get List jQuery Create Read of All Table Nam es in Cookie Get Set Database Delete Cookies ...

jQuery Make Checkboxes Checked Selected Mode w ith Nam e

How to Clear Textbox jQuery Clear Textbox Value w ith jQuery Value on focus

ConfirmbuttonExtender AjaxCalendarExtender AjaxDragPanelExtender

19 comments :
Dwayne said... small error in your code 1) //Below tags are mandatory rss tagTextWriter.WriteStartElement("rss"); should be two lines //Below tags are mandatory rss tag TextWriter.WriteStartElement("rss"); 2)this gave an error so I deleted it using System.Linq; Otherwise it works great! :)

AjaxRatingControl AjaxSlideshowExtender Arraylist Assembly Authorization Captcha Custom Right Click Menu DataGrid Generic List HTML Address ImportContacts ListBox MCC Award Panorama Image

Viewer Plugins Print RSSFeeds

DIV

Product

Reviews QueryString text file

RadioButtonList

Read/Write

ReadOnlyValues Repeater Resize Image Reviews RichTextBox SQL Constraints SiteMap Social Media Bookmark Plugins Checker Testimonial Example Testing Trace Mobile Number Try Catch UpdatePanel VBScript Virtual Keyboard WPF Audio Plugins jQuery Mobile jQuery Video Plugins top/bottom of div setInterval setTimeOut

December 31, 2010 at 6:01 PM Suresh Dasari said...

Thanks Dwayne thanks for rectify my mistake i modified the code now it's working fine

January 17, 2011 at 5:40 PM chinuexpert said... hey hi, i create an application by following above procedure & steps but on front page i.e. on aspx page which control we should use to display rss feeds? plz tell me it's important for me.

December 27, 2011 at 9:12 PM

www.aspdotnet-suresh.com/2010/04/creating-rss-feed-using-aspnet-with-c.html#more

3/6

12/22/13

how to Create RSS feed Using Asp.net | RSS Feed Sample using asp.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSR
Suresh Dasari said...

@chinuexpert, No need of any control just create the page based on above process and run it output will display.

December 27, 2011 at 9:24 PM Anonymous said... grt work

February 20, 2012 at 11:29 PM Anonymous said... nice post

May 22, 2012 at 7:13 AM Shafeeq said... awsome you are

August 11, 2012 at 4:23 AM Anonymous said... Tell me something about Sharepoint also..

September 12, 2012 at 9:36 PM Anonymous said... i got a result in xml format

November 20, 2012 at 3:14 AM Anonymous said... thanx a lot sir

10

November 26, 2012 at 3:50 AM Anonymous said...

11

This feed contains errors. Internet Explorer will try updating this feed again later.iam getting this as result.Ihave 12 rows of data but display onli one row .

November 26, 2012 at 9:18 PM Masilamani Rajamanickam said... my result in xml format. how can i get rss feeds

12

December 3, 2012 at 3:40 AM Anonymous said... in chrome....the result is xml format.how to get actual rss feeds

13

January 9, 2013 at 3:47 AM Anonymous said... grt post thanks

14

March 17, 2013 at 3:52 PM Janaki Lenagala said... Hi, I want to create a RSS feed for a asp.net web page by using jquery.How should I do? please help me..

15
4/6

www.aspdotnet-suresh.com/2010/04/creating-rss-feed-using-aspnet-with-c.html#more

12/22/13

how to Create RSS feed Using Asp.net | RSS Feed Sample using asp.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSR
May 16, 2013 at 10:02 PM Leslie C said... 3 years later and this code and still good. I needed a simple rss solution and this got me up and running in no time. Thank you for the post!

16

September 20, 2013 at 3:58 PM Sanjay Gupta said...

17

This XML file does not appear to have any style information associated with it. The document tree is shown below. i am applying this then my output like this error

September 30, 2013 at 10:16 PM Raj Kumar said... Your output is generating in rss.aspx page, but i've to do generate it in xml like rss.xml. How can i achieve this?

18

October 2, 2013 at 7:50 PM Sanjay Gupta said... i want display image in rss feed.......

19

October 3, 2013 at 10:01 PM

Give your Valuable Comments

Enter your comment...

Comment as:

Google Account

Publish

Preview

Newer Post Subscribe to: Post Comments ( Atom )

Home

Older Post

Other Related Posts


Asp.net Asp.net M ove Selected Gridview Rows to Another Gridview in Asp.net - ASP ... C# - What is Difference between Overriding and ... - Asp.net C# - What is Delegates in C# Example | Use of Delegates ... - Asp.net

3 tier architecture example in asp.net with C# Asp.net insert, Edit, update, delete data in gridview Introduction to Object Oriented Programming Concepts (OOPS) in C#.net Interview Questions in ASP.NET,C#.NET,SQL Server,.NET Framework Introduction to WCF - WCF tutorial | WCF Tutorial - Windows Communication Foundation | WCF Example | WCF Sample code in asp.net 3.5 | Basic WCF Tutorial for Beginners jQuery 360 Degrees Image Display Plugins Examples with Tutorial how to insert images into database and how to retrieve and bind images to gridview using asp.net (or) save and retrieve images from database using asp.net

www.aspdotnet-suresh.com/2010/04/creating-rss-feed-using-aspnet-with-c.html#more

5/6

12/22/13

how to Create RSS feed Using Asp.net | RSS Feed Sample using asp.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSR
Simple login form example in asp.net Check Username and Password availability in database Asp.net WebService or Creating and Consuming WebService in asp.net or Create and call webservice in asp.net or how to create webservice and how to use webservice in asp.net Ajax M odalPopUpExtender Example to edit the gridview row values in asp.net

2010-2012 Aspdotnet-Suresh.com. All Rights Reserved. The content is copyrighted to Suresh Dasari and may not be reproduced on other w ebsites w ithout permission from the ow ner.

www.aspdotnet-suresh.com/2010/04/creating-rss-feed-using-aspnet-with-c.html#more

6/6

You might also like