Last post Aug 28, 2007 08:36 AM by Desigen
Aug 25, 2007 03:39 PM|Desigen|LINK
I need help, I installed RSS ToolKit and I want to build RSS for newsCategory and for newsComment.
I did Google about example but I didn't find any thing helpful. I have been working for 5 hours. and I did zero "nothing useful"
I want to do RSS using ashx files. using RSS ToolKit. also how can I publish them. and make IE and FF determine that this page is providing RSS.
My table in DataSet is generated by this SQL Statement.
SELECT TOP (10) NewsId, CategoryId, NewsTitle, NewsSubTitle, NewsPublishDate, NewsBody
WHERE (CategoryId = @CategoryId)
ORDER BY NewsPublishDate DESC
Thanks in advance.
Aug 27, 2007 11:31 PM|landan|LINK
Have your handler inherit from the RssDocument Handler - RssDocumentHttpHandler, allowing you to override the PopulateRss method to build your feed.
You'll want to build the channel - Rss.Channel = new RssChannel();, where you can populate it with RssItems - Rss.Channel.Items = new List<RssItem>();
Then I guess you'll want to iterate throught your DataSet table rows and build RssItems to add to your channel.
RssItem item = new RssItem();
From there, your handler wont actually publish the feed because the content type is set to "text/xml", so use the RssHyperlink with the NavigateUrl pointing to your handler.
Aug 28, 2007 08:36 AM|Desigen|LINK
Hi, thanks for answering. I solved the problem.
I wrote an aspx page for RSS Feed.
The page Output text/xml and write the feed on the browser
Is this a good way to do that?