I'm using a XmlTextReader to grab an RSS feed from another website (with their permission of course!).
Works great but I'm designing it to handle problems with connectivity. When the feed goes down the page currently hangs for quite some time before rendering with a message explaining the feed is currently unavailable. I believe the time it hangs is the web request timeout value but has anyone got any idea how to reduce it so the page displays quicker? There seem to be no properties related to this in the XmlTextReader object.
Help appreciated.Code:try { XmlTextReader _xmlReader = new XmlTextReader( ConfigurationSettings.AppSettings["NewsXmlFeedUrl"]); DataSet _dsStories = new DataSet(); _dsStories.ReadXml(_xmlReader); //Other stuff here lblFeedError.Visible = false; pnlFeeds.Visible = true; } catch (Exception exp) { lblFeedError.Text = "<p>XML news feed has failed.</p>"; lblFeedError.Visible = true; pnlFeeds.Visible = false; }
DJ



Reply With Quote