Programatically refresh web form

  • Thread starter Thread starter Jorge Varona
  • Start date Start date
J

Jorge Varona

Greetings,
I have been struggling with a problem the past two days. I need to force a
refresh/postback on a web form through code. After searching Deja the best
answer is that I can't do it through server-side code and that it must be
done through JavaScript on the client. Can anyone shed some light on this
and help me out. Thanks.
 
This is correct. The browser must initiate all communication with the
server; it cannot happen the other way around due to the stateless nature of
HTTP.
You can do this from client side code such as javascript:
location.reload();

Or you can have the client refresh on a regular basis with a meta tag like
this:
<META HTTP-EQUIV="refresh" CONTENT="3">
That will cause the browser to refresh every 3 seconds.

If you need richer communication you'll have to design it yourself using a
thick client and your own networking code.
For this kind of thing you can use the TCPChannel class.
Here's more info:
http://www.dotnet247.com/247reference/msgs/20/103391.aspx
http://msdn.microsoft.com/library/d...meRemotingChannelsTcpTcpChannelClassTopic.asp
 
Back
Top