473,785 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1384
"Jonathan Wood" <jw***@softcirc uits.comwrote in message
news:ey******** ********@TK2MSF TNGP05.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***@softcirc uits.comwrote in message
news:ey******** ********@TK2MSF TNGP05.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**@markNOSPA Mrae.netwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
"Jonathan Wood" <jw***@softcirc uits.comwrote in message
news:ey******** ********@TK2MSF TNGP05.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***@softcirc uits.comwrote in message
news:u5******** ******@TK2MSFTN GP05.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**@markNOSPA Mrae.netwrote in message
news:eV******** ******@TK2MSFTN GP02.phx.gbl...
"Jonathan Wood" <jw***@softcirc uits.comwrote in message
news:u5******** ******@TK2MSFTN GP05.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***@softcirc uits.comwrote in message
news:ex******** ******@TK2MSFTN GP03.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
1168
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
2437
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 the deleted items don't disappear on Postback, but only after a page refresh. I assume this is because the DataList is not redatabound unless !Postback. However, if I remove the if(!Postback) statement, the button's 'delete' method doesn't seem...
3
9568
by: MyWebTV | last post by:
how to refresh an indiviual user control without refresh entrire page
4
2508
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 same thing as an Auto-postback? My page does not refresh with current data if you leave it, go to another page and return; but if you manually do a refresh of the page (using the Refresh button on the toolbar in IE), the page refreshes/reloads with...
1
2107
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 via a postback. So if you click save in our app, itll call save again if you refresh. I would like to grab that refresh and have it execute a different command which clears out the screen and repopulates the latest data (i.e. a real refresh) but...
5
1112
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 confirmation message is displayed, the email is sent a second time (or a third, fourth, fifth, etc.). What can I do to prevent the Refresh button from resending the email? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
1
3483
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 refresh - which makes me think I'm doing a postback. I've also tried "return false" in both the onclick and OnClientClick events. No Luch. Can I use the onclick or OnClientClick (or something else) to fire a javascritpt function and then stop? ...
2
2915
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 TreeView, the page stops auto-refreshing. Any ideas why this is happening? I have acheived auto refresh using the following:
3
1811
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 database, hit the button, then hit the refresh button and here's where my question occurs. I get a message saying that "it needs to resubmit/resend the data?" what is happening here and how do I resolve this undesired message?
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10152
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.