473,763 Members | 3,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RSS feed <> sql server <> aspx <> xml <> blog

I have been researching articles on google on how to create a simple RSS
feed that sucks <title><blurb>< link><date> out of a sql server 2000 database
via an aspx page.

I know it has to be pushed into a <xml> document but not sure which
direction to take.

Is there perhaps a starter document which uses sql server as the data source
I can tap into.

I am a newbie to aspx but I it appears there is a lot of inbuilt support for
this application and I don't wish to go down to many wrong paths or reinvent
the wheel.

Any advice appreciated!

Jason

ps: It appears that <rss> is tied in heavily with <blogs> these days....is
anyone come up with a combined solution?
Nov 19 '05 #1
3 2764
Here's the meat of the the rss.aspx that I use for blogabond.com. As
you can see, it's just a single repeater dumping out XML instead of
HTML. Couldn't be much simpler, though you'll need to remember to set
the ContentType on the server:

Page.Response.C ontentType = "text/xml";

<?xml version="1.0" ?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="ht tp://purl.org/rss/1.0/modules/slash/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
<channel>
<title>Blogabon d.com - Livin' large in the third world</title>
<link>http://www.blogabond.c om/</link>
<description>Tr avel journals and photo blogs from world travellers.
Maps, research and resources for the aspiring vagabond.</description>
<dc:language> en-US</dc:language>
<dc:creator></dc:creator>
<copyright>Copy right © 2005, Blogabond.com</copyright>
<sy:updatePerio d>daily</sy:updatePeriod >
<sy:updateFrequ ency>1</sy:updateFreque ncy>
<sy:updateBase> 1</sy:updateBase>
<asp:Repeater ID="rptComments " Runat=server>
<ItemTemplate >
<item>
<title><%# DataBinder.Eval (Container.Data Item,
"CommentTitle") %></title>
<description> <![CDATA[<%# GetDescription(
DataBinder.Eval (Container.Data Item, "CommentTex t"),
DataBinder.Eval (Container.Data Item, "UserID") )%>]]></description>
<author><%# GetAuthorName( DataBinder.Eval (Container.Data Item,
"UserID") )%></author>
<category><%# GetLocationName ( DataBinder.Eval (Container.Data Item,
"LocationID ") )%></category>
<pubDate><%# GetPubDate( DataBinder.Eval (Container.Data Item,
"CommentDat e") )%></pubDate>
<link>http://www.blogabond.c om/TripView.aspx?t ripID=<%#
DataBinder.Eval (Container.Data Item, "TripID")%> </link>
<guid
isPermaLink="tr ue">http://www.blogabond.c om/CommentView.asp x?commentID=<%#
DataBinder.Eval (Container.Data Item, "CommentID" )%></guid>
<slash:comments >0</slash:comments>
</item>
</ItemTemplate>
</asp:Repeater>
</channel>
</rss>

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #2
Dude, awesome - its been a long time since anyone has posted a full set of
example code for an inept <newbie /> such as myself. :)) Thanks!!

My first stupid question:

I sucked your code into aspx container page in web matrix (free) and tried
executing and obviously it generates a compile error with regards the
content type.

How do I actually insert the content type onto the page below?

I have done some searches on 'content type examples text/xml'.

I pick up a compilation error when I add this to the page:

<%Page ContentType="Te xt/Xml">

What am I doing wrong?

Nov 19 '05 #3
That needs to live on the codebehind (or possibly in a <script
runat=server> if you're not using codebehinds). Here is a small chunk
of mine. Obviously you'll need to generate your own dataset to bind
the repeater, and you'll need to write your own helper functions to
format dates and HtmlEntityEncod e strings:

protected Repeater rptComments;

private void Page_Load(objec t sender, System.EventArg s e)
{
Page.Response.C ontentType = "text/xml";

DataView dv = TripReportComme nt.List().Table s[0].DefaultView;
dv.Sort = Comment.Columns .CommentDate + " desc";

rptComments.Dat aSource = dv;
rptComments.Dat aBind();

}

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3231
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td> <td>..<tr>.<td> <td> </table>" content to
2
10568
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
3
1730
by: z. f. | last post by:
Hi, i'm using code in my aspx page. i have data binding where i use <%# Container.DataItem("DateStart") %> i also use code that makes a loop inside a regular <% %> block how can i pass data from the databinding to the loop that runs in a regular
0
1346
by: Adam | last post by:
Hi I split aspx for 1. aspx - www 2. vb But i have problem because Statement is not valid in a namespace. I don't know while this don't power becouse befor split wab all OK Please Help Me Thank You Code in the VB mports System
5
1894
by: ad | last post by:
I find there are some tag like <%= %> and <%# > in my .aspx file. What is the diffreence between <%= %> and <%# %>
29
3679
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form id="Form1" method="post" runat="server"> <%
3
3381
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
2
2059
by: -Karl | last post by:
Couls someone please advise me on this error. What I am trying to do is be able to convert an XML document into arrays. I read that the subs & functions have to be in <scripttags. Thanks! Error: BC30456: 'Read_DOM' is not a member of
4
3511
by: emanning | last post by:
I'm having problems using "<>" as criteria for a varchar column in a view. The data in this column is '2008-2009' which is supposed to mean year 2008 thru 2009. If I set the criteria to "= '2008-2009'" then the view returns just those rows with that field equal to "2008-2009", like I would expect it to. But if I change the criteria to "<'2008-2009'", the view returns nothing. And there are rows to return. I tried CAST and CONVERT,...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.