IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
C#
Search C# Group:

Advanced
-Collapse +Expand C# To/From
To/FromCODEGuides
-Collapse +Expand C# Study Test
PRESTWOODCERTIFIED
-Collapse +Expand C# Store
PRESTWOODSTORE

Prestwood eMagazine

March Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingC#WebForms Cod...   Print This     
  From the June 2013 Issue of Prestwood eMag
 
C# WebForms Coding Tasks:
Consuming an RSS feed in ASP.NET
 
Posted 10 years ago on 5/1/2010
C# Code Snippet:
 A flashcard from our C# Flashcards Library
 A code snippet from our C# Code Snippets Page
 Tags: RSS , DataGrid

KB102107

Using this quickie code snippet, you can attach an ASP:Gridview  to an external RSS Feed.

All you need to accomplish this is the URL of a usable feed.

Syntax Example:

Create a ASP AJAX webform, and drop in a GRIDVIEW control, and a button.  Double click the button control and add this code.  You'll need to add these two namespaces to your using section.

using System.Xml;
using System.Data;

This snippet will fill it with DICE ASP.NET open postings.

protected void Button1_Click(object sender, EventArgs e)
{
    XmlTextReader myReader = new
XmlTextReader("http://rss.dice.com//system/net-jobs.xml");
    DataSet myDataSet = new DataSet();
    myDataSet.ReadXml(myReader);
    GridView1.DataSource=myDataSet.Tables[3];
    GridView1.DataBind();
}

Comments

1 Comments.
Share a thought or comment...
Comment 1 of 1

how to integrate in Integrating Partial Rendering into an Existing. Project this is

Posted 15 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1302A1
Enter key:
Code Contributed By Bryan Valencia:

Bryan Valencia is the author of millions of lines of code and writes for PrestwoodBoards and Visual Studio Journey on-line magazines.

Visit Profile

 KB Article #102107 Counter
18886
Since 5/1/2010
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2020 Prestwood IT Solutions.   [Security & Privacy]