By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,465 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

Programatically refresh web form

P: n/a
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.

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/247referenc...20/103391.aspx
http://msdn.microsoft.com/library/de...ClassTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Jorge Varona" <jo***@ocaelectrical.com> wrote in message
news:ub*************@TK2MSFTNGP11.phx.gbl...
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.

Nov 17 '05 #2

P: n/a
If you want the functionality without refreshing the browser, then this is a
lil tough, but
try it out using remote scripting.

http://authors.aspalliance.com/thyco...view.aspx?id=4

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ee**************@TK2MSFTNGP12.phx.gbl...
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/247referenc...20/103391.aspx
http://msdn.microsoft.com/library/de...ClassTopic.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Jorge Varona" <jo***@ocaelectrical.com> wrote in message
news:ub*************@TK2MSFTNGP11.phx.gbl...
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.


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.