I have a Magazine Module where a person can create articles. Before saving the article, he can set the date on when it will be published, like today, a day from now or a month perhaps.
What I need now is to an updated XML file that will be used as RSS feed for my frequent reader.
There was 2 solution that I thought of.
The first was to create an ASPX page (localhost/dnn/RSS.aspx). Here's just a sample of code behind:
private void Page_Load(object sender, System.EventArgs e)
{
Response.ContentType = "text/xml";
Response.ContentEncoding = Encoding.UTF8;
// check to see if a cached version exists
if (Cache["RssFeed"] == null )
{
string s1;
// code for filling the content of s1 is added here
Cache.Insert("RssFeed", s1, null, DateTime.Now.AddHours(1.5), TimeSpan.Zero);
}
Response.Write(Cache["RssFeed"].ToString());
Response.End();
}
|
This worked perfectly fine but I don't know if this will have DNN security issues. Will it?
Second solution was to create a DNN Module, where the code-behind will be similar like the one above. The problem with this is when I added the link of this page (localhost/dnn/rss/tabid/500/default.aspx) on a RSS reader, it says that it has incorrect format or not readable. When I check the source of the page, it has this:
<?xml version="1.0"?> <rss version="2.0"><channel><title>Liftoff News</title><link>http://liftoff.msfc.nasa.gov/</link><description>Liftoff to Space Exploration.</description><pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate><lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate><docs>http://blogs.law.harvard.edu/tech/rss</docs><generator>Weblog Editor 2.0</generator><managingEditor>editor@example.com</managingEditor><webMaster>webmaster@example.com</webMaster> <item> <title>Star City</title> <link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link> <description>How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's <a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm">Star City</a>.</description> <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate> <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid> </item> <item> <description>Sky watchers in Europe, Asia, and parts of Alaska and Canada will experience a <a href="http://science.nasa.gov/headlines/y2003/30may_solareclipse.htm">partial eclipse of the Sun</a> on Saturday, May 31st.</description> <pubDate>Fri, 30 May 2003 11:06:42 GMT</pubDate> <guid>http://liftoff.msfc.nasa.gov/2003/05/30.html#item572</guid> </item> </channel></rss><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en-US">
<head id="Head">
<!--**********************************************************************************-->
<!-- DotNetNuke� - http://www.dotnetnuke.com -->
<!-- Copyright (c) 2002-2008 -->
<!-- by DotNetNuke Corporation -->
<!--**********************************************************************************-->
<meta id="MetaDescription" name="DESCRIPTION" content="RSS" /><meta id="MetaKeywords" name="KEYWORDS" content=",DotNetNuke,DNN" /><meta id="MetaCopyright" name="COPYRIGHT" content="Copyright 2007 by My Website" /><meta id="MetaGenerator" name="GENERATOR" content="DotNetNuke " /><meta id="MetaAuthor" name="AUTHOR" content="My Website" /><meta name="RESOURCE-TYPE" content="DOCUMENT" /><meta name="DISTRIBUTION" content="GLOBAL" /><meta name="ROBOTS" content="INDEX, FOLLOW" /><meta name="REVISIT-AFTER" content="1 DAYS" /><meta name="RATING" content="GENERAL" /><meta http-equiv="PAGE-ENTER" content="RevealTrans(Duration=0,Transition=1)" /><style id="StylePlaceholder" type="text/css"></style><link id="_DotNetNuke_Portals__default_" rel="stylesheet" type="text/css" href="/DotNetNuke/Portals/_default/default.css" /><link id="_DotNetNuke_Portals__default_Skins_Mortgage_" rel="stylesheet" type="text/css" href="/DotNetNuke/Portals/_default/Skins/Mortgage/skin.css" /><link id="_DotNetNuke_Portals_0_" rel="stylesheet" type="text/css" href="/DotNetNuke/Portals/0/portal.css" /><title>
RSS
</title></head>
<body id="Body">
....
</body>
</html>
|
it seems like that the DNN structure is added though I used the function Response.End().
I tried to use a skin where it will just have the div tag for Content Pane, but still it's still shows the DNN structure.
Neither creating an XML file manually, nor creating a module that will create an XML file automatically is an option. It's because the admin does not know exactly when there will be a newly published article and it'll be hassle if he'll always check the CMS for such.
With this, are there any solutions? If so, how?
Thanks in advance