Rss: Bookmark is not working correctly.

Posted by shruti on Stack Overflow See other posts from Stack Overflow or by shruti
Published on 2010-04-28T08:52:29Z Indexed on 2010/04/28 9:13 UTC
Read the original article Hit count: 218

Filed under:

I'm working on project RSS generation in MVC.Net. in taht i want to make bookmark. for that i have write the code on controller. first there is one aspx page from which subscription page gets open.

public ActionResult ViewBlog() { if (Session[SessionVariables.username] == null) { return RedirectToAction("Login", "Home"); } else { return View(classObj.fetchAllBlogs()); } }

and coding for subscription is: public ActionResult Rss() {

           string bcontent = classObj.showBlog();
           DateTime postdate = classObj.showPostDate();

           List<SyndicationItem> items = new SyndicationItem[] 
        {
            new SyndicationItem("RSS Blog",bcontent+postdate,null),       
        }.ToList();

           RssResult r = new RssResult();
           SyndicationFeed feed = new SyndicationFeed("Admin: Blog Posts", "RSS Feed",Request.Url , items);
           return new RssResult(feed);

        Developer", "The latest news on ASP.NET, C# and ASP.NET MVC ");
    }

but problem is that when usr clicks on bookmark then intested of opening ViewBlog.aspx it opens the same page. i want to open ViewBlog.aspx. I think the problem is in: SyndicationFeed feed = new SyndicationFeed("Admin: Blog Posts", "RSS Feed",Request.Url , items);

Plz help ...!

© Stack Overflow or respective owner

Related posts about asp.net-mvc