forcing a page reload?

W

WAZOO

Sorry if this is obvious to everyone (except me). I've done a Google search
and I'm not seeing anything encouraging that addresses my issue.

My very large multispecialty medical practice needs to alert various nurses
and med techs - squirreled away in back offices - when an arrived parient
requires their services. It's a simple matter for me to implement a little
MSAccess database with +/- buttons to increment the arrivals queue.
MedTechs can look at this page and and see if they need to go out to the
waiting room to get a patient that requires their services.

I believe I can include something like:

<META HTTP-EQUIV="refresh" CONTENT="90">

in my HTML and cause the "client" to refresh every 90 seconds.

But, what I really want to do is force the page to reload at the nurse
stations only each time a change is made. I want to iterate through the
active sessions and execute something like:

Response.Write("<script language='javascript'>location.reload();</script>")

and cause the screen at the nurses' stations to refresh each time the girls
at the fromt desk queue up a patient for blood work or whatever.

Can anyone help us out with this?
 
M

Matt Berther

Hello WAZOO,

Because of the stateless nature of HTTP, this is not possible. You'll have to go with the meta refresh.
 
C

Cor Ligthert

Hi Wazoo,

If you do not get any better you can try this sample I once made.
This is a webclock and I think it take to much from your connection, however
when nothing helps, you can bring it down and let it fire more slow.

If you do not understand some things, feel free to ask.

I hope it helps anyhow?

Cor

\\\Form 1 Needs a imagebox on the page
' The application name has to be WebClock
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.Image1.Height = New Unit(32)
Me.Image1.Width = New Unit(200)
Image1.Visible = True
Dim scriptString As String = "<script language=JavaScript>" & _
"setclock(); function setclock(){document.images.Image1.src = " & _

"'http://localhost/WebClock/WebForm2.aspx';setTimeout('setclock()',1000)}</s
cript>"
Page.RegisterStartupScript("setclock", scriptString)
End Sub
///
\\\Form2 needs nothing
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Response.Cache.SetExpires(DateTime.Now.AddTicks(500))
Dim myForeBrush As Brush = Brushes.Black
Dim myFont As New Font("Times New Roman", 8, FontStyle.Regular)
Dim textHeight As Single
Dim bm As New Bitmap(120, 20)
Dim g As Graphics = Graphics.FromImage(bm)
g.Clear(Color.White)
Dim textSize As SizeF = g.MeasureString("now.tostring", myFont)
g.DrawString(Now.ToString, myFont, myForeBrush, _
New RectangleF(0, 0, 120, 20))
Dim ms As New IO.MemoryStream
Dim arrImage() As Byte
bm.Save(ms, Imaging.ImageFormat.Bmp)
arrImage = ms.GetBuffer
Response.BinaryWrite(arrImage)
g.dispose
End Sub
///
 
B

bruce barker

use a hidden frame to do the polling, and reload the parent only when there
is a change. this is a pretty lightweight, as the hiddenframe content is
very small.


-- bruce (sqlwork.com)
 
Ø

Øystein Fallo

bruce barker said:
use a hidden frame to do the polling, and reload the parent only when there
is a change. this is a pretty lightweight, as the hiddenframe content is
very small.

Or you might consider using a webservice, download via xmlhttp through
javascript, and transform to html.
I've succesufully used this method using asp3.0...
rgds
Øystein Fallo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top