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"Jonathan Wood" <jwood@.softcircuits.com> wrote in message
news:ey%236Y56aIHA.4696@.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
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" <jwood@.softcircuits.com> wrote in message
news:ey%236Y56aIHA.4696@.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
>
Wednesday, January 23, 2008
2:10 PM
This is a matter of where you're doing your databinding and how...
Say you have a grid and you have something like this you may have trouble
if not isPostback then
griddatabinding ()
…
end if
I am suggesting that your databinding is done in code. If so, then you will
experience the kind of problem you are indicating. If you have disable
viewstate then you will also loose your grid style assuming you did every
thing programmatically.
The answer
If not isPostback the n
…
End if
' move this outside your if statement
Griddatabinding()
You may have something similar in your code. If not post some code so we
can help analyze the problem.
aaa
"Jonathan Wood" wrote:
> 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
>
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]" <mark@.markNOSPAMrae.net> wrote in message
news:%239LdMa8aIHA.4140@.TK2MSFTNGP04.phx.gbl...
> "Jonathan Wood" <jwood@.softcircuits.com> wrote in message
> news:ey%236Y56aIHA.4696@.TK2MSFTNGP05.phx.gbl...
>
> 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
"Jonathan Wood" <jwood@.softcircuits.com> wrote in message
news:u5MixDCbIHA.4144@.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
Oh well.
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Mark Rae [MVP]" <mark@.markNOSPAMrae.net> wrote in message
news:eV7S8AFbIHA.3572@.TK2MSFTNGP02.phx.gbl...
> "Jonathan Wood" <jwood@.softcircuits.com> wrote in message
> news:u5MixDCbIHA.4144@.TK2MSFTNGP05.phx.gbl...
>
> You still persist in top-posting, though...
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
"Jonathan Wood" <jwood@.softcircuits.com> wrote in message
news:ex1KAdFbIHA.5348@.TK2MSFTNGP03.phx.gbl...
> Oh well.
Learning how to snip would be useful too...
Mark Rae
ASP.NET MVP
http://www.markrae.net
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment