This project is read-only.

Widget Autorefresh

Topics: Controls
Feb 4, 2012 at 2:49 AM

I want to add a webcam image within the Textbox Widget.  Does anyone know of a way to have the widget update itself at a specified interval?  I don't want the primary site refresh, just the widget or the image within the widget.

Feb 4, 2012 at 5:16 AM

If you look at most of the admin/settings pages, "save" button does Ajax call instead of postback. You'd need do similar - load widget content with JavaScript calling web method in code behind and repeating it using JS timer. Callback function would reload only "div" content.

Feb 8, 2012 at 8:02 PM

I believe I got this work work using just simple javascript.  Now to fire up the webcam..

<p><a title="Webcam at Flentje Headquarters" href="" target="_blank"><img id="webcam" src="" alt="" name="webcam" width="200" height="150" border="0" /></a></p>
<p>Webcam at Flentje Headquarters</p>

<script type="text/javascript" language="JavaScript">// <![CDATA[
function reloadImage() {
    var now = new Date();
    if (document.images) { = '' + now.getTime();

// ]]></script>