Aim of this application is to display RSS feed from a link in the LinkButtons inside a Panel which is created for each RSS feed link at runtime.
Program Flow is like this -
- Parent Panel (title=“Sample Application”) is created and on its preinitialize event loadConfig() is called. loadConfig() will load the Configuration.xml and fill in the XMLListCollection urlList with its childnodes (<url address=“http://www.ndtv.com/convergence/ndtv/rssnat.asp” title=“NDTV India news”/> etc…).
- 1st Repeater (id=“newsPanel”) takes urlList as dataProvider and will loop as many times as we have urls in Configuration.xml (In our case we have 2 urls there.)
- A VDividedBox and Panel pair are created inside this repeater and on the preinitialize event of the VDividedBox loadXML(String) is called. This function will fetch the RSSFeed of the link that we pass as the String parameter inside it. The RSS data that is fetched is stored as an XMLListCollection in externalXML.
- externalXML acts as a dataProvider for the second Repeater (id=“newsItems”) and creates as many LinkButtons in the Panel as there are <title> tags in externalXML. The label on these linkButtons will display RSS feed to the end user.
In the two pairs of VDividedBox-Panel, RSS feed from two different urls provided in Configuration.xml should be displayed.
Run the project and you’ll see that in BOTH pairs of VDividedBox-Panel, RSS feed from the first link is being displayed at runtime. And after a fraction of a second the RSS feed in both the Panels will get overwritten by RSS feed from the second link.