|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Timer Component for VB 2005 .aspx page?I'm creating a website that monitors the status of servers using
My.Computer.Network.Ping. I'm looking for a way to fire off my Ping() function every second or so. I see a Timer control availalble for Windows forms but it is not listed for my .ASPX page. Is there such a control? Thanks. Ryan,
There should be such a control in Atlas, standard you can make it like this. http://www.vb-tips.com/default.aspx?ID=1f32c947-d0c9-456c-b02b-4d681b3d530a I hope this helps, Cor Show quoteHide quote "Ryan" <Tyveil@newsgroups.nospam> schreef in bericht news:OwnQkqohGHA.3896@TK2MSFTNGP02.phx.gbl... > I'm creating a website that monitors the status of servers using > My.Computer.Network.Ping. I'm looking for a way to fire off my Ping() > function every second or so. I see a Timer control availalble for Windows > forms but it is not listed for my .ASPX page. Is there such a control? > > Thanks. > Hello Ryan,
As for the timer component, I assume that you're going to perform some constant operations in your ASP.NET application. Is this operation specific to individual webform page or is a application wide operations(like a backgroun worker...)? The article Cor has provided demonstrates how to create javascript client-side timer which will constantly call a script function in the web page's client-sdie html document. However, if what you want is a server-side backgroun timer, I think you would need to create a server-side background worker thread or a System.Timers.Timer instance to do the work .e.g. ================== void Application_Start(object sender, EventArgs e) { Timer timer = new System.Timers.Timer(); HttpContext.Current.Application["g_timer"] = timer; timer.Elapsed += new ElapsedEventHandler(this.OnTimedEvent); timer.Interval = 4000; timer.Enabled = true; } =========================== Regards, Steven Cheng Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) Thanks Steven, this works. However, I have images on my page showing the
status of the servers being pinged and these images are not being changed on the fly. My Ping function changes the ImageURL property based on whether the Ping succeeds or fails (green image for success, red for failure). Do I have to re-load the entire page just to update a single image or is there another way to get just that image to update dynamically on the page? Thanks. Show quoteHide quote "Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message news:m8Cb18EiGHA.5184@TK2MSFTNGXA01.phx.gbl... > Hello Ryan, > > As for the timer component, I assume that you're going to perform some > constant operations in your ASP.NET application. Is this operation > specific to individual webform page or is a application wide > operations(like a backgroun worker...)? The article Cor has provided > demonstrates how to create javascript client-side timer which will > constantly call a script function in the web page's client-sdie html > document. However, if what you want is a server-side backgroun timer, I > think you would need to create a server-side background worker thread or a > System.Timers.Timer instance to do the work .e.g. > > ================== > void Application_Start(object sender, EventArgs e) > { > Timer timer = new System.Timers.Timer(); > > HttpContext.Current.Application["g_timer"] = timer; > > timer.Elapsed += new ElapsedEventHandler(this.OnTimedEvent); > timer.Interval = 4000; > timer.Enabled = true; > > > } > =========================== > > Regards, > > Steven Cheng > Microsoft Online Community Support > > > ================================================== > > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > > ================================================== > > > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > > Get Secure! www.microsoft.com/security > (This posting is provided "AS IS", with no warranties, and confers no > rights.) > Just wanted to add that I know the Ping() function is being called because I
put a msgbox("Ping function called") within the function and it pops up on the webpage every 2 seconds. All I want to know is how do I change an image on the page (stored in an Image object). Changing the ImageURL does not seem to be doing the trick. Thanks! Show quoteHide quote "Ryan" <Tyveil@newsgroups.nospam> wrote in message news:OEBstcKiGHA.4304@TK2MSFTNGP05.phx.gbl... > Thanks Steven, this works. However, I have images on my page showing the > status of the servers being pinged and these images are not being changed > on the fly. My Ping function changes the ImageURL property based on > whether the Ping succeeds or fails (green image for success, red for > failure). Do I have to re-load the entire page just to update a single > image or is there another way to get just that image to update dynamically > on the page? > > Thanks. > > > "Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message > news:m8Cb18EiGHA.5184@TK2MSFTNGXA01.phx.gbl... >> Hello Ryan, >> >> As for the timer component, I assume that you're going to perform some >> constant operations in your ASP.NET application. Is this operation >> specific to individual webform page or is a application wide >> operations(like a backgroun worker...)? The article Cor has provided >> demonstrates how to create javascript client-side timer which will >> constantly call a script function in the web page's client-sdie html >> document. However, if what you want is a server-side backgroun timer, I >> think you would need to create a server-side background worker thread or >> a >> System.Timers.Timer instance to do the work .e.g. >> >> ================== >> void Application_Start(object sender, EventArgs e) >> { >> Timer timer = new System.Timers.Timer(); >> >> HttpContext.Current.Application["g_timer"] = timer; >> >> timer.Elapsed += new ElapsedEventHandler(this.OnTimedEvent); >> timer.Interval = 4000; >> timer.Enabled = true; >> >> >> } >> =========================== >> >> Regards, >> >> Steven Cheng >> Microsoft Online Community Support >> >> >> ================================================== >> >> When responding to posts, please "Reply to Group" via your newsreader so >> that others may learn and benefit from your issue. >> >> ================================================== >> >> >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> >> >> Get Secure! www.microsoft.com/security >> (This posting is provided "AS IS", with no warranties, and confers no >> rights.) >> > > Hello Ryan,
Thanks for your response. Actually, the background thread or a global Timer approach I mentioned just provide the capability of executing some background code or tasks. If you want constantly do some thing and then update a page's UI, I think you'd better consider Cor's suggestion about use javascript function "setTimeout" or "setInterval" to execute some script code constantly. And you can use javascript to update a certain image object's url and that change will take effect immediately at client-side. e.g.: var img = document.getElementById("imgTitle"); img.src = "new image url"; If you want to get some certain status info from server-side, you can consider use xmlhttp components to send request to server page or handler and get updated info. (AJAX is just such a technology which provide non-refresh communication between client and server in web application). #Client Script in ASP.NET Web Pages http://msdn2.microsoft.com/en-us/library/3hc29e2a.aspx #setTimeout or setInterval http://javascript.about.com/library/blstvsi.htm http://www.evolt.org/article/Using_setInterval_to_Make_a_JavaScript_Listener /17/36035/ Hope this helps. Regards, Steven Cheng Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) Hello Ryan,
How are you doing on this issue? Does my further reply helps a little? Please feel free to post here if there is still anything we can help you. Regards, Steven Cheng Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) Hi Steven,
Actually this project has gotten pushed back as another more pressing project has come in for me to work on so I haven't had a chance to try this out yet. Thanks for the links though which I have saved and I will certainly look them over closer when I can get back to this. Ryan Show quoteHide quote "Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message news:VpAt10qiGHA.4500@TK2MSFTNGXA01.phx.gbl... > Hello Ryan, > > How are you doing on this issue? Does my further reply helps a little? > Please feel free to post here if there is still anything we can help you. > > Regards, > > Steven Cheng > Microsoft Online Community Support > > > ================================================== > > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > > ================================================== > > > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > > Get Secure! www.microsoft.com/security > (This posting is provided "AS IS", with no warranties, and confers no > rights.) > Sure Ryan,
Please feel free to post here when you meet further problem on this issue later or let me know if you got any progress. Good luck! Regards, Steven Cheng Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) Ryan,
Special for you made my fellow Ken this Tip. http://www.vb-tips.com/dbPages.aspx?ID=413a84da-5395-4b76-bfe3-d62c0c562ffe I hope this helps, Cor Show quoteHide quote "Ryan" <Tyveil@newsgroups.nospam> schreef in bericht news:%23FiUxD0iGHA.4276@TK2MSFTNGP03.phx.gbl... > Hi Steven, > > Actually this project has gotten pushed back as another more pressing > project has come in for me to work on so I haven't had a chance to try > this out yet. Thanks for the links though which I have saved and I will > certainly look them over closer when I can get back to this. > > Ryan > > > "Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message > news:VpAt10qiGHA.4500@TK2MSFTNGXA01.phx.gbl... >> Hello Ryan, >> >> How are you doing on this issue? Does my further reply helps a little? >> Please feel free to post here if there is still anything we can help you. >> >> Regards, >> >> Steven Cheng >> Microsoft Online Community Support >> >> >> ================================================== >> >> When responding to posts, please "Reply to Group" via your newsreader so >> that others may learn and benefit from your issue. >> >> ================================================== >> >> >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> >> >> Get Secure! www.microsoft.com/security >> (This posting is provided "AS IS", with no warranties, and confers no >> rights.) >> > > Steven,
> var img = document.getElementById("imgTitle"); I thought as well on that solution, problem with is, that you have to know > img.src = "new image url"; > the name of the image (it cannot have the same name because than it will get it again from cache). You don't know that name, therefore you see in my sample that removing from cache from the page where the image is in. (At least I cannot remove a single image from cache in using a webpage). :-) CorShow quoteHide quote > > If you want to get some certain status info from server-side, you can > consider use xmlhttp components to send request to server page or handler > and get updated info. (AJAX is just such a technology which provide > non-refresh communication between client and server in web application). > > > #Client Script in ASP.NET Web Pages > http://msdn2.microsoft.com/en-us/library/3hc29e2a.aspx > > #setTimeout or setInterval > http://javascript.about.com/library/blstvsi.htm > > http://www.evolt.org/article/Using_setInterval_to_Make_a_JavaScript_Listener > /17/36035/ > > Hope this helps. > > Regards, > > Steven Cheng > Microsoft Online Community Support > > > ================================================== > > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > > ================================================== > > > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > > Get Secure! www.microsoft.com/security > (This posting is provided "AS IS", with no warranties, and confers no > rights.) >
String wierdness...
Access database insert statement with an autonumber (identity) in vb.net Datagrid current row edits Thread question Thread Question trying to download VS2005 from MSDN Does file exist Converting Code from VBA to VB.NET Exposing a .Net assembly to both VB6 and .Net (1 more time) InvalidCastException in DataRow |
|||||||||||||||||||||||