Monday, April 28, 2008

RSS Feeds in asp.net with c#

A simple Program to view xml in Datagrid

using System.Xml;


XmlTextReader reader = new XmlTextReader("http://msdn.microsoft.com/rss.xml");

// creates a new instance of DataSet

DataSet ds = new DataSet();

// Reads the xml into the dataset

ds.ReadXml(reader);

// Assigns the data table to the datagrid

myDataGrid.DataSource = ds.Tables[2];

// Binds the datagrid

myDataGrid.DataBind();

Using RSS Feeds with Asp.net

RSS stands for (Really Simple Syndication). Basically RSS feeds are xml files which are provided by many websites so you can view their contents on your own websites rather than browsing their site. Suppose you are a movie lover and you want to get the list of top 5 movies from 10 websites. One way will be to visit all 10 websites and see the top 5 list. This method though is used in general by lot of people but its quite tiring method. It will take you 10-15 minutes to browse all the websites and see the top 5 list of movies. One easy way will be if those movie websites provides RSS feeds to be used by the users. If they provide RSS feeds you can embed them in your page and now you don't have to browse all the websites since the information is available on a single page. Hence, this saves you a time and a lot of browsing.

Most of the Blogs websites provide RSS feeds so you can embed your or someone's else latest entries of blog on your website. In this article we will see how we can embed RSS feeds to our webform using Asp.net.

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...