tags:

views:

13

answers:

0

I'm working on a project for RSS generation in ASP.NET MVC. In that I want to make a bookmark. For that I have written the code on the controller. First there is one aspx page from which the subscription page gets opened:

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

and the code 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);

  }

But problem is that when the user clicks on the bookmark then instead of opening ViewBlog.aspx it opens the same page. I want it to open the ViewBlog.aspx page. I think the problem is in:

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

help...