.NETGURU
timer in a custom control?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolscs' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

dennismc@attbi.com
-- Moved from [aspngcontrolscs] to [aspngcontrolscs] by devin <Click here to reveal e-mail address> --

I am implementing a "news wire" custom control. It is
supposed to periodically poll a web service for new news
stories. How can I do this in an ASP.NET control?

If it were a Windows control, I would just include a
Timer. But I need the timer to run in the browser, and
trigger a postback to my control when the timer interval
expires. There is a window.SetInterval function in
JavaScript, but how can a control produce script that
will be executed when the page that contains the control
is loaded into the browser?

Thanks,
Dennis

Reply to this message...
 
    
Paul Brenner
[Original message clipped]

see System.Web.UI.Page.RegisterClientScriptBlock and
System.Web.UI.Page.RegisterStartupScript.

Thanks,
Dennis
| [aspngcontrolscs] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolscs.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
    
Scott Watermasysk (VIP)
Dennis,

You might want to just cache your news items. Once the cache expires, on the
next postback you can hit the web service, get your updates and re-cache the
data for your specified time frame.

I put together a sample control that retrieves data from the KBAlertz XML
newsfeed. The returned dataset is then cached for x (can be set by the user
of the control) numbers of minutes.

The control and full source code can be found at:
http://TripleASP.Net/KBAlertz.aspx?navid=34

HTH,
Scott

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 20, 2002 9:55 AM
To: aspngcontrolscs
Subject: [aspngcontrolscs] timer in a custom control?

-- Moved from [aspngcontrolscs] to [aspngcontrolscs] by devin
<Click here to reveal e-mail address> --

I am implementing a "news wire" custom control. It is
supposed to periodically poll a web service for new news stories. How can I
do this in an ASP.NET control?

If it were a Windows control, I would just include a
Timer. But I need the timer to run in the browser, and
trigger a postback to my control when the timer interval expires. There is
a window.SetInterval function in
JavaScript, but how can a control produce script that
will be executed when the page that contains the control
is loaded into the browser?

Thanks,
Dennis
| [aspngcontrolscs] member Click here to reveal e-mail address =
| YOUR ID http://www.asplists.com/asplists/aspngcontrolscs.asp =
| JOIN/QUIT http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification