473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 1359
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jo | last post by:
Hi I was wondering if it's possible to cause a postback/refresh on a .NET web app from within server side code Thanks Jo
4
by: John | last post by:
Hi - I've got a couple of pages where a DataList is populated only if(!Postback). I have buttons in the datagrid that allow for the 'deletion' of items from that DataList. The problem is that...
3
by: MyWebTV | last post by:
how to refresh an indiviual user control without refresh entrire page
4
by: Coleen | last post by:
Hi All :-) I have a web page that I need to refresh every time the page loads. I thought that the page automatically did a refresh/postback on the Page_Load event. Isn't refreshing the page the...
1
by: Areric | last post by:
Hey all, Does anyone know how i can detect a refresh of the page in the unload event on the server? The problem I'm having is that refresh automatically calls the previous event that happened...
5
by: Nathan Sokalski | last post by:
I have a page which allows the user to send emails. After they click the submit button, I display a confirmation message. However, if the user clicks the browser's Refresh button once the...
1
by: Matthew Wells | last post by:
Hello. I'm trying to use an asp - not html - button without having a postback or a screen refresh. I've tried turning off "CausesValidation" and "UseSubmitBehavior" and I still get a screen...
2
by: =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post by:
Hi I have a web page that has a TreeView on it. If I DONT'T expand the TreeView nodes, the auto refresh works nicely: my page gets refreshed every minute. As soon as I expand a node on the...
3
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hi all, i betcha here's a question never asked before ;) i have a simple web form with a gridview and a button. the button doesn't do anything but a postback. i load up the gridview from the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.