p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 19th, 2008, 05:41 PM
Friend of Wrox
Points: 1,376, Level: 14
Points: 1,376, Level: 14 Points: 1,376, Level: 14 Points: 1,376, Level: 14
Activity: 20%
Activity: 20% Activity: 20% Activity: 20%
 
Join Date: Jul 2005
Location: , , .
Posts: 298
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.NET XML Feed Error

I have an ASP.NET page that parses an external XML feed (please see code below). It works...but when the feed goes down, it subsequently brings my site down. So I've created a default XML document that's located on my internal server a backup method when/if the external feed goes down. But I have no idea how to do this. If someone could let me know how to accomplish this, or point me in the right direction, that would be great. Thanks in advance.

ASP.NET XML FEED CODE
Code:
'Check for active amber alert
Dim strAlertTitle As String, strAlertDescription As String
Dim intAlertCounter As Integer = 0
Dim alert_xmld As XmlDocument
Dim alert_nodelist As XmlNodeList
Dim alert_node As XmlNode
'Create the XML Document
alert_xmld = New XmlDocument()

'Load the Xml file
alert_xmld.Load("http://codeamber.org/a1xl04act/amberalert.xml") 'LIVE
        'alert_xmld.Load("http://www.mysite.com/docs/xml/alert.xml") 'DEFAULT XML DOC TO USE AT DOWNTIME

'Get the list of name nodes
alert_nodelist = alert_xmld.SelectNodes("/AmberAlerts/AmberAlert[Alertstatus/@status = 'open' and contains(Alertinfo/@states, 'CO')]")

'Loop active amber alerts
For Each alert_node In alert_nodelist
    intAACounter = intAACounter + 1
    If intAACounter >= 1 Then
        strAlertTitle = "Amber Alert"
        strAlertDescription = "There is currently an amber alert in Colorado."
    Else If intAACounter = 0 Then
        strAlertTitle = "Amber Alert"
        strAlertDescription = "There are currently no amber alerts in Colorado."
    End If
Next 'end loop

Response.Write(strAlertTitle & ": " & strAlertDescription & "<br /><br />")
KWilliams
__________________
KWilliams
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementing RSS FEED in Asp.Net suresh_net RSS and Atom 0 August 8th, 2008 11:15 AM
Problems parsing XML Feed in Javascript kwilliams Classic ASP Professional 0 December 18th, 2007 06:33 PM
parse error xml load document asp.net academics2006 ASP.NET 1.0 and 1.1 Basics 0 March 13th, 2006 03:21 PM
xml feed with javascript jon8884 Javascript 5 June 22nd, 2005 02:15 PM
XML news feed sankar XML 1 December 17th, 2003 05:28 AM



All times are GMT -4. The time now is 07:45 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc