Simple RSS Feed Display

This demo illustrates displaying the RSS <item> elements from a remote RSS feed using a DataGrid. Note that the code to accomplish this is about five lines long! (Also note that the data shown in this demo is a snapshot of the RSS feed's data from Monday, March 17th. A static RSS feed is used to reduce load on the ASPMessagboard.com server.)


titlelinkdescriptiondatePostedchannel_Id
Truly FUNNY! (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=30&P=1&M=561128Message by Bill Wilkinson on 3/17/2003 5:46:20 PM EST
About 3 minutes after I typed that in I got the little window:
"Automatic updates have been downloaded and are ready for installation. Do you want to install them now?"

If you say "later" it gives you a choice of when (30 minutes, one hour, two hours, tomorrow, etc.).

3/17/2003 5:46:20 PM0
And I repeat the question <eom> (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561127Message by Bill Wilkinson on 3/17/2003 5:43:50 PM EST
.
3/17/2003 5:43:50 PM0
Web Service / File transfer. (helpme07)http://www.aspmessageboard.com/forum/showMessage.asp?F=36&P=1&M=561126Message by helpme07 on 3/17/2003 5:41:12 PM EST
Is it possible to transfer files(other then bmp) via a webservice and if so how?
3/17/2003 5:41:12 PM0
RE: LOL! Yeah, it's kind of esoteric... (Francis Leyland)http://www.aspmessageboard.com/forum/showMessage.asp?F=21&P=1&M=561125Message by Francis Leyland on 3/17/2003 5:40:47 PM EST
I did look at the documentation, but because I am a beginner at all this, the possibility of converting datatypes (or even the need for it) didn't occur to me. So I didn't look in the right places.

Anyway, I will now go away and investigate....

Thanks once again
3/17/2003 5:40:47 PM0
RE: HOW do you display it? (jholmes)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561124Message by jholmes on 3/17/2003 5:38:43 PM EST
i never gave any input to the database so it should be null, not "null" ( i mean, i don't SEE "null" in the database, so...).

what happens is i register a new user in my form, then in the member directory it displays fine. i leave that as it is, go into the database manually, edit a field, and then when i refresh the member directory, there it is, that cursed "null"...
3/17/2003 5:38:43 PM0
With XP it is automatic... (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=30&P=1&M=561123Message by Bill Wilkinson on 3/17/2003 5:36:08 PM EST
...unless you tell it you don't want them, you get update messages. I get them at home from time to time.

Dunno about other OS versions.

Check your HELP for "Automatic Updates" and see if there is anything there.

Oh...what the heck...let me check here...just a sec...

Yeah, it's a setting in the SYSTEM sub-control-panel of Control Panel. It's a separate tab on the panel, in fact.


3/17/2003 5:36:08 PM0
RE: God, this is close right?? (rachelmnms)http://www.aspmessageboard.com/forum/showMessage.asp?F=38&P=1&M=561122Message by rachelmnms on 3/17/2003 5:34:40 PM EST
Hi Doug... am I on the right track with this .xsl file from my problem above?

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:output">http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="xml"/>
<xsl:template match="/">

<xsl:apply-templates select="SelectResult"/>

</xsl:template>

<xsl:template match="SelectResult">
<Status>
<StatusCd><xsl:value-of select="Status/StatusCd"/></StatusCd>
<StatusDesc><xsl:value-of select="Status/StatusDesc"/></StatusDesc>
</Status>
<SvcRs>
<RqUID><xsl:value-of select="SvcRs/RqUID"/></RqUID>
<xsl:apply-templates select="ViewInqRs"/>
</SvcRs>
</xsl:template>

<xsl:template match="ViewInqRs">
<ViewInqRs id="{id}">
<![CDATA[ created_dt: ]]> <xsl:apply-templates select="created_dt"/>
<![CDATA[ created_tm: ]]> <xsl:apply-templates select="created_tm"/>
<![CDATA[ request_id: ]]> <xsl:apply-templates select="request_id"/>
</ViewInqRs>
</xsl:template>

</xsl:stylesheet>

Thanks

Rach
3/17/2003 5:34:40 PM0
HOW do you display it? (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561121Message by Bill Wilkinson on 3/17/2003 5:31:31 PM EST
And what is *REALLY* in that field? Is it truly NULL or did you goof and accidentally put the string "null" in there? (Which is not *at all* the same thing.)

3/17/2003 5:31:31 PM0
Click on Customize Forum Display (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=24&P=1&M=561120Message by Bill Wilkinson on 3/17/2003 5:29:46 PM EST
Yes, I got Scott to change the <STYLE> he was using so that it uses one of the standard CSS font size *names* instead of the silly "8 pt." absolute size he was using. Now you can adjust it to your own liking.

(My old eyes couldn't handle 8 pt. on a 1200x1600 screen!)

3/17/2003 5:29:46 PM0
display of null from database (jholmes)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561119Message by jholmes on 3/17/2003 5:28:23 PM EST
when a user registers, the member directory table display works fine. one thing it displays is State / Province; in this test case, that column is empty. but if i go into the database and manually change a field, the member directory table then displays "null" where there should be nothing. i tried doing a little nullFilter function to make it "" if it was "null" but that doesn't work. everything in the database appears fine, i just get that "null" display where there should be nothing... ideas??
3/17/2003 5:28:23 PM0
Not that I know of... (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561118Message by Bill Wilkinson on 3/17/2003 5:27:49 PM EST
...other than maybe executing the SEND in VBS code and using ON ERROR to trap and get the info from the ERR object?

<SCRIPT Language="VBScript" RunAt=Server>
Function doSend( mailobj )
Err.Clear
On Error Resume Next
mailobj.Send
If Err.Number <> 0 Then
doSend = Err.Number & ": " & Err.Description
Else
doSend = "Okay" ' or whatever you prefer
End If
End Function
</SCRIPT>
<%
... js code ...

oops = doSend( emailObject )
if ( oops != "Okay" )
{
...
}
...
%>

UGH! But it should work.

3/17/2003 5:27:49 PM0
bigger text (Chaotix)http://www.aspmessageboard.com/forum/showMessage.asp?F=24&P=1&M=561117Message by Chaotix on 3/17/2003 5:27:00 PM EST
is it just my eyes, or is the text bigger in the message listings?
3/17/2003 5:27:00 PM0
Auto email from microsoft? (Chaotix)http://www.aspmessageboard.com/forum/showMessage.asp?F=30&P=1&M=561116Message by Chaotix on 3/17/2003 5:25:56 PM EST
Does Microsoft provide a server where you are emailed when a new security bulletin requiring a patch is needed? I don't like waiting to hear about them days after a hole has been found.
3/17/2003 5:25:56 PM0
RE: Plus no need to use this (youeee)http://www.aspmessageboard.com/forum/showMessage.asp?F=21&P=1&M=561115Message by youeee on 3/17/2003 5:22:52 PM EST
Thanks pete.

This worked a treat... I think I may even get used to this oracle thing.
3/17/2003 5:22:52 PM0
RE: Nope...can't find a way... (jholmes)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561114Message by jholmes on 3/17/2003 5:20:40 PM EST
yeah, same with me... might there be a different solution other than using try...catch??
3/17/2003 5:20:40 PM0
Yes, but... (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=27&P=1&M=561113Message by Bill Wilkinson on 3/17/2003 5:18:54 PM EST
...you have to set up ASP to AllowOutOfProcComponents

Look on MSDN for that subject to find out how to do that.

Or search the forums here; I'm sure somebody posted the answer in last week or two.

3/17/2003 5:18:54 PM0
Nope...can't find a way... (Bill Wilkinson)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561112Message by Bill Wilkinson on 3/17/2003 5:14:36 PM EST
apparently, try...catch wasn't designed to be used for system-raised errors.

Best I can get it to do is say that the caught variable is an object of type Error. But I can't find any properties of that object.

3/17/2003 5:14:36 PM0
Easy .xml to .xsl to .xml again?? (rachelmnms)http://www.aspmessageboard.com/forum/showMessage.asp?F=38&P=1&M=561111Message by rachelmnms on 3/17/2003 5:05:37 PM EST
OK... here's the situation. We've got some .xml coming in to our system and then we're going to .xsl it and kick out a .xml file to be used down the line. Below is the .xml file and the .xsl file as far as I've gotten. Together they produce a very nice <![CDATA[]]> line, but we need it to look like the "DESIRED RESULTS" below. Anyone? Ideas? Comments? Examples you can point me to?

INPUT .xml FILE:
<?xml version="1.0"?>
<SelectResult>
<Status>
<StatusCd>0</StatusCd>
<StatusDesc>Success</StatusDesc>
</Status>
<SvcRs>
<RqUID>W7D2DD0607C894AB0AAEBE37CB13B3A55W</RqUID>
<ViewInqRs id="P350A17B7FCF241F7809D13FDF614DD39P">
<created_dt>05/05/2000 00:00:00</created_dt>
<created_tm>01/01/1900 14:02:46</created_tm>
<request_id>100002</request_id>
</ViewInqRs>
</SvcRs>
</SelectResult>

.xsl FILE (so far):
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:output">http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="xml"/>
<xsl:template match="/">
<xsl:apply-templates select="SelectResult"/>
</xsl:template>

<xsl:template match="SelectResult">
<![CDATA[ created_dt: ]]> <xsl:apply-templates select="SvcRs/ViewInqRs/created_dt"/>
<![CDATA[ created_tm: ]]> <xsl:apply-templates select="SvcRs/ViewInqRs/created_tm"/>
<![CDATA[ request_id: ]]> <xsl:apply-templates select="SvcRs/ViewInqRs/request_id"/>
</xsl:template>

</xsl:stylesheet>

DESIRED RESULTS:
<?xml version="1.0"?>
<SelectResult>
<Status>
<StatusCd>0</StatusCd>
<StatusDesc>Success</StatusDesc>
</Status>
<SvcRs>
<RqUID>W7D2DD0607C894AB0AAEBE37CB13B3A55W</RqUID>
<ViewInqRs id="P350A17B7FCF241F7809D13FDF614DD39P">
created_dt: 05/05/2000 00:00:00 created_tm: 01/01/1900 14:02:46 request_id: 100002 </ViewInqRs>
</SvcRs>
</SelectResult>


Basically the output .xml file is exactly the same as the input .xml file with the only difference being we need to <![CDATA[]]> everything between ViewInqRs. How do I get the elements above like <RqUID> into the .xml file for output as it is in the input .xml file? All clues are much appreciated...

Thanks

Rachel

3/17/2003 5:05:37 PM0
Hyper link column in a datagrid??? (gummadilli)http://www.aspmessageboard.com/forum/showMessage.asp?F=36&P=1&M=561110Message by gummadilli on 3/17/2003 4:54:40 PM EST
hi friends ...i have a small doubt in asp.net..if u have idea pls give me a idea..i have a datagird in my webpage...in that grid the first column is hyperlink column..when i click a link in that column i have to redirected to that perticular page according to the link name.....pls give me a idea how to do that.....



the exact req is

i have a grid with 2 columns
schoolname year
---------------------
lpark school 2002
bloominton 2003
chg public sch 2003


assume that the school names are links to pages lpark.aspx .....
when i click that lparh school in that grid i have to redirect to lpark.aspx...same as to all the rows in that column

pls give me a idea how to do that


Thanks again
satya
3/17/2003 4:54:40 PM0
RE: Damn...& Blast (sip1976)http://www.aspmessageboard.com/forum/showMessage.asp?F=20&P=1&M=561109Message by sip1976 on 3/17/2003 4:51:26 PM EST
Damn keyboards........

That works fine, thx
3/17/2003 4:51:26 PM0


Source Code
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Data" %>
<script language="VB" runat="server">
  Sub Page_Load(sender as Object, e as EventArgs)
    recentPosts.DataSource = GetRSSFeed("http://www.aspmessageboard.com/scripts/rss.xml")
    recentPosts.DataBind()      
  End Sub


  Function GetRSSFeed(strURL as String) as DataTable
    'Get the XML data
    Dim reader as XmlTextReader = New XmlTextReader(strURL)
    
    'return a new DataSet
    Dim ds as DataSet = New DataSet()
    ds.ReadXml(reader)    
    Return ds.Tables(2)
  End Function
</script>
  
<asp:DataGrid runat="server" id="recentPosts" />

[Return to the article]