Re: XMLDOM, the System.Xml namespace and refreshing data
From: BCM (BCM_at_none.com)
Date: 09/16/04
- Next message: Regan: "Link MapQuest to an app."
- Previous message: Job Lot: "Best Practices: Passing values between forms"
- In reply to: Baavgai: "Re: XMLDOM, the System.Xml namespace and refreshing data"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Sep 2004 09:44:21 -0400
Perfect! You made my day.
Cheers,
Brad
"Baavgai" <brettmc@gmail.com> wrote in message
news:cialob$63p@odbk17.prod.google.com...
> This kind of thing should work for the XML stuff.
>
> System.Xml.XmlDocument xmlDoc = null;
>
> public void GetData() {
> xmlDoc=new System.Xml.XmlDocument();
> xmlDoc.Load(@"c:\myxmldoc.xml");
> }
>
> public void Update() {
> string myLabelText=
> xmlDoc.GetElementsByTagName("TimeStamp")[0].InnerText;
> idMyLabel.innerText=myLabelText;
> }
>
> Peace,
> Brett
>
> BCM wrote:
>> In ASP 3, I once did a page using javascript and XMLDOM that loaded
> up xml
>> files, displayed their data, and automatically refreshed that data at
> 10
>> second intervals (not a whole page refresh: just the data in the
> particular
>> node I wanted to display). The javascript looked something like:
>>
>>
>>
>> function GetData()
>>
>> {
>>
>> xmldoc = new ActiveXObject("Microsoft.XMLDOM");
>>
>> xmldoc.load("c:\\myxmldoc.xml");
>>
>> }
>>
>>
>>
>> function Update()
>>
>> {
>>
>> var myLabelText =
>> (xmldoc.getElementsByTagName("TimeStamp").item(0).text);
>>
>> idMyLabel.innerText = myLabelText;
>>
>> }
>>
>>
>>
>> function Init()
>>
>> {
>>
>> GetData();
>>
>> setInterval(GetData(),9000); //grab the xml doc every 9 seconds
>>
>> setInterval(Update(),10000); //update the html with the data it
> contains
>> every 10 seconds
>>
>> }
>>
>>
>>
>> Then, in the HTML form, I would just call Init() during the body
> onLoad
>> event.
>>
>>
>>
>> Surely there is a similar technique in ASP.NET using the System.XML
>> namespace, but after a day and a half I wave the white flag! Any
>> suggestions? Thanks in advance!
>
- Next message: Regan: "Link MapQuest to an app."
- Previous message: Job Lot: "Best Practices: Passing values between forms"
- In reply to: Baavgai: "Re: XMLDOM, the System.Xml namespace and refreshing data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|