Hello DNN Doctors!
I have a question. I'm trying to use Razor to create RSS Feeds. There's been quite a bit of trial and error but the code below is now rendering correctly:
@{ Layout = null; Response.ContentType = "application/rss+xml"; var db = Database.Open("SiteSqlServer"); var dbData = "STORED PROCEDURE CODE HERE"; } FEED TITLE IMAGE URL IMAGE TITLE WHERE IMAGE LINKS TO FEED DESCRIPTION 60 @foreach (var row in db.Query(dbData)) { @: @row.title @: @row.link @: @row.guid @: }
The problem I'm having is that all of the DNN gobbledy-gook is rendering as well so it doesn't display as an actual RSS Feed eventhough I'm changing the ContentType in the code. I believe this has something to do with my skin file as its still referencing the skinning engine. Here is that code:
<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" EnableViewState="false" %>
<div id="ContentPane" runat="server">
As you can see, its quite basic. Its referencing DotNetNuke.UI.Skins.Skin and I think that may be the problem but when I remove that I get a 500 - Internal server error. Yet when I include it, I get the gobbledy-gook.
What shall I do? If that snippet of code needs to be replaced, what should I replace it with to get just the actual xml code to display?
Hello Moderator, it looks like the code I included in my original post got mangled. How do I add code snippets to a post? Also can you please delete this post and I will repost it in such a way where the code can be clearly seen and understood.
What shall you do?
What about https://github.com/DNNCom...N.NewsFeeds/releases ?
Sorry, it looks like my code was mangled on the initial post. Here is the code that is partially working.
I really try to avoid 3rd party mods. The Razor Host module is so versatile, outside mods aren't as needed.
Is there no way to do this with the core tools?
Skin code:
Posted By Faith Coder on 1/29/2026 1:41 PM Hello Moderator, it looks like the code I included in my original post got mangled. How do I add code snippets to a post? Also can you please delete this post and I will repost it in such a way where the code can be clearly seen and understood.
BTW, you said you prefer no other modules, but I use the Open Content in some case like you use the Razor Host module, as a "template" can also be a single razor file. (with @dnn helpers included). But "on steroids" as you can easily add custom settings for instance. An example: https://github.com/40fing...03.10-Razor-DNN-Menu
Thanks everyone for your feedback.
The code below is working. Basically I'm using razor to create an XML file on the server and populate it using file IO operations. No third-party mods have been installed. This is just using the core tools.
Does anyone see any problems with doing it this way as I know that just because something works doesn't necessarily mean it should be done :-)
These Forums are for the discussion of the open source CMS DNN platform and ecosystem.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.