469,927 Members | 1,855 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Since when is a Refresh a PostBack?

I'm getting into the habit of checking IsPostBack in my Form_Load handler
and not updating the page if it is a postback.

However, I notice that if I hit my browser's refresh button, the page
refreshes without any data.

Since when is a refresh a postback?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Feb 10 '08 #1
6 1275
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:ey****************@TK2MSFTNGP05.phx.gbl...
Since when is a refresh a postback?
The Refresh button reloads the page in exactly the way that it was
originally loaded... If it was originally loaded as a result of a postback,
then hitting the Refresh button will cause it to be reloaded as from a
postback...

This is standard browser behaviour...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 10 '08 #2
A postback is no more than setting 2 hidden fields __EVENTTARGET and
__EVENTARGUMENT and calling the form's submit() method.

What hitting the Refresh button does is repeating the last submit() call
with exactly the same settings of all fields. Hence you get the effect you
are observing.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:ey****************@TK2MSFTNGP05.phx.gbl...
I'm getting into the habit of checking IsPostBack in my Form_Load handler
and not updating the page if it is a postback.

However, I notice that if I hit my browser's refresh button, the page
refreshes without any data.

Since when is a refresh a postback?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Feb 10 '08 #3
Yeah, okay, I may have more going on here than I originally thought.

Thanks for putting me back on the right track.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:ey****************@TK2MSFTNGP05.phx.gbl...
>Since when is a refresh a postback?

The Refresh button reloads the page in exactly the way that it was
originally loaded... If it was originally loaded as a result of a
postback, then hitting the Refresh button will cause it to be reloaded as
from a postback...

This is standard browser behaviour...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Feb 10 '08 #4
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:u5**************@TK2MSFTNGP05.phx.gbl...
Thanks for putting me back on the right track.
You still persist in top-posting, though...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 11 '08 #5
Oh well.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eV**************@TK2MSFTNGP02.phx.gbl...
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:u5**************@TK2MSFTNGP05.phx.gbl...
>Thanks for putting me back on the right track.

You still persist in top-posting, though...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Feb 11 '08 #6
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:ex**************@TK2MSFTNGP03.phx.gbl...
>You still persist in top-posting, though...

Oh well.
Learning how to snip would be useful too...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 11 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jo | last post: by
4 posts views Thread by John | last post: by
4 posts views Thread by Coleen | last post: by
1 post views Thread by Areric | last post: by
5 posts views Thread by Nathan Sokalski | last post: by
1 post views Thread by Matthew Wells | last post: by
2 posts views Thread by =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post: by
3 posts views Thread by =?Utf-8?B?cm9kY2hhcg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.