Click here to Skip to main content
15,908,455 members
Please Sign up or sign in to vote.
2.25/5 (3 votes)
See more:
can anybody please help me for

loading xml for blog feed from

"" url

or how to fetch blog feeds from url

Updated 26-Feb-14 0:55am
[no name] 26-Feb-14 6:58am

[no name] 26-Feb-14 7:02am use this url and make a webrequest, u shall receive feed in xml, later use the obtained xml and bind it to xmldatasource,later, link the datasource to datalist. or else there are plenty of jquery tools like news ticker and others, make use of them with jquery ajax get call to fetch feed from above url....

I have recently completed your kind of task.So I hope I can give you a maximum support.Please ask any question about this.

Here is the code snippets which I have used.

/// <summary>
        /// to Get Blog Rss Feeds
        /// </summary>
        private List<RssReader> GetBlogRssFeeds(string rssUrl)
            var rssFeed = XDocument.Load(rssUrl);

            var rssFeedOut = from item in rssFeed.Descendants("item")
                             select new RssReader
                                 Title = item.Element("title").Value,
                                 Link = item.Element("link").Value,
                                 Description = ((item.Element("description") != null) ? Regex.Replace(Regex.Replace(item.Element("description").Value, @"<[^>]+>|&nbsp;", "").Trim(), @"\s{2,}", " ") : "").Substring(0, 389),
                                 ImageSrc = (item.Element("description") != null) ? Regex.Match(item.Element("description").Value, "<img.+?src=[\"'](.+?)[\"'].*?>", RegexOptions.IgnoreCase).Groups[1].Value : "",

            return rssFeedOut.ToList();

/// <summary>
    /// RssReader model
    /// </summary>
    public class RssReader
        public string Link { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public string ImageSrc { get; set; }


<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<RssReader>>" %>
 <div id="divBlogContent">

                    <% foreach (var p in Model)
                       { %>
                    <tr style="font-size: 18px; font-weight: bold; text-decoration: underline;">
                        <td colspan="2">
                            <%= Html.Encode(p.Title) %>
                        <td style="width: 400px; font-weight: normal; text-align: left">
                            <%= Html.Encode(p.Description) %>
                        <td style="width: 300px">
                            <img src="<%: p.ImageSrc %>" alt="Smiley face" height="120" width="200">

                    <% } %>
Share this answer
Member 9425683 26-Feb-14 11:54am    
can you please send me also code where you displayed data ,means html
Sampath Lokuge 27-Feb-14 1:36am    
I have updated my answer.Please check that.
thatraja 3-Mar-14 2:44am    
Sampath Lokuge 3-Mar-14 2:46am    
Thanks Thatraja. :)
How to read and display RSS FEED in

for Complete Source Code visit:

private void PopulateRssFeed()
            string RssFeedUrl = "";
            List<Feeds> feeds = new List<Feeds>();
                XDocument xDoc = new XDocument();
                xDoc = XDocument.Load(RssFeedUrl);
                var items = (from x in xDoc.Descendants("item")
                             select new
                                 title = x.Element("title").Value,
                                 link = x.Element("link").Value,
                                 pubDate = x.Element("pubDate").Value,
                                 description = x.Element("description").Value
                if (items != null)
                    foreach (var i in items)
                        Feeds f = new Feeds 
                         Title = i.title,
                         Link =,
                         PublishDate = i.pubDate,
                         Description = i.description


                gvRss.DataSource = feeds;
            catch (Exception ex)
Share this answer
thanks i got result.this is working fine for me.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900