tags:

views:

31

answers:

0

I creted RSSResult.cs file in Controler

this is the code I wrote.. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.ServiceModel.Syndication; using System.Xml;

public class RssResult : ActionResult
{
    public SyndicationFeed Feed { get; set; }

    public RssResult() { }

    public RssResult(SyndicationFeed feed)
    {
        this.Feed = feed;
    }

    public override void ExecuteResult(ControllerContext context)
    {
        context.HttpContext.Response.ContentType = "application/rss+xml";
        Rss20FeedFormatter formatter = new Rss20FeedFormatter(this.Feed);
        using (XmlWriter writer = XmlWriter.Create(context.HttpContext.Response.Output))
        {
            formatter.WriteTo(writer);
        }
    }
}

and In the HomeControler.cs

public ActionResult Rss()
{
    List<SyndicationItem> items = new SyndicationItem[] 
    {
        new SyndicationItem("Google Main Page", "This is some content", new Uri("http://www.google.com")),
        new SyndicationItem("A", "This is some content", new Uri("http://www.A.com")),
        new SyndicationItem("CNN Main Page","This is some content", new Uri("http://www.cnn.com")),
    }.ToList();

    SyndicationFeed feed = new SyndicationFeed("News Feeds", "", new Uri("URL"),items);
    return new RssResult(feed);
}

The problem is

when ever I got this page I getting small popup window to add to the bookmark.. I am adding to the bookmark after adding I can see all those URL links which I mensioned in HOmeControle.cs file...

next tym when I reparet the same thing for going to tha tpage.. again its poping up to add to the bookmark why its doing that?

why I am not able to see the window there I will have the URLS for UI?

and how to update these URLs from databse?

THank in adavance..